Menu

(Solved) : M Beginner Java Learned Else Statement Loop Nested Loop Java Using Three Write Codes Prob Q26544609 . . .

I’m a beginner in JAVA. Just learned If else statement, loop,and nested loop in JAVA.
Using those three write codes for…

Problem 1:
Ask the user to enter a width (integer between 1 and 50). Usingthat entered value:
Print a line of “width” asterisks (*).
That is, if the user enters 3, print 3 asterisks on oneline:***

Problem 2:
Print a square box of *s with the given width (and height). Thatis, if the user enters 3, print:
***
***
***

Problem 3:
Print a box with a hole in its center.
That is, print a box as in #2 but with the single * in the center(or a *close to the center for boxes with an even width) replacedwith a space.
For example, if the user inputs 5, print:
*****
*****
** **
*****
*****

Write codes between curly brackets after pulic static voidproblem#.

For example:
public static void problem2() { //write codes here }

Expert Answer


Answer to M Beginner Java Learned Else Statement Loop Nested Loop Java Using Three Write Codes Prob Q26544609 . . .

OR