Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The C# program will ask the user to enter the length and width of a rectangle, and then display the rectangles length, width and area

The C# 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. (See sample output below) The programs Main function must call the following four functions:

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 themain 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

image text in transcribed

Sample Output: Enter the length: -5 ERROR: Enter a positive number. Enter the length: 15 Enter the width: -3 ERROR: Enter a positive number. Enter the width: 30 Rectangle Data Length: 15 Width: 30 Area: 450 Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

Finding and scheduling appointments with new prospective clients.

Answered: 1 week ago