Question: Create a new NetBeans project called Ex 2 Rectangle. 2 . Code a solution in java code that allows the user to enter the length

Create a new NetBeans project called Ex2Rectangle.
2. Code a solution in java code that allows the user to enter the length and width of a rectangle, and then calculate the area. Your
program must have the following user defined methods:
getLength() prompts the user for and returns length. Do not allow a value <1.
getWidth() prompts the user for and returns width. Do not allow a value <1.
calcArea() accepts length and width as parameters and returns area. area = length * width.
displayArea accepts length, width, and area as parameters and displays length, width and area.
Major point deduction if any/all of these are missing

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 Programming Questions!