Question: Rectangle Area: The program will ask the user to enter the length and width of a rectangle, and then display the rectangles length, width and

Rectangle Area: The program will ask the user to enter the length and width of a rectangle, and then display the rectangles length, width and area on the computer screen. The programs Main function must call the following four functions written in C#:

getLength This function should ask the user to enter the rectangles length, validate it, and then return that value as a double to the main function.

getWidth - This function should ask the user to enter the rectangles width, validate it, and then return that value as a double to the main function.

getArea This function should accept the rectangles length and width as arguments, compute the rectangles area with these arguments and return the rectangles area to the main function. The area is calculated by multiplying the length by the width.

displayData This function should accept the rectangles length, width, and area as arguments, and display them in an appropriate message on the computer screen (see sample output below). Input Validation:

Do not accept length and width values lower than 0.

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!