Question: Write the main() method of a program that receives two integer parameters, hhh and www, and then prints #'s on the screen so that they

Write the main() method of a program that receives two integer parameters, hhh and www, and then prints #'s on the screen so that they take the shape of a parallelogram having hhh and line and width www for each line. For each parameter, the program prompts the user to enter the parameter. If the entered parameter is not positive, the program informs the user about it without producing the shape on the screen. The report can be by way of printing an error message.

The programming language to be used here is java!

Here is a sample execution of the code:

Enter hhh: 6

Enter www: 3

###

###

###

###

###

###

Here is a sample execution of the code:

Enter hhh: 4

Enter www: 6

######

######

######

######

Here is another sample where an error message is shown:

Enter hhh: -5

Enter www: 4

Both parameters must be positive

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!