Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Autho Tracking Changes Compare You will write a main program that prompts the user to enter the length and width of a rectangle You will

image text in transcribed
Autho Tracking Changes Compare You will write a main program that prompts the user to enter the length and width of a rectangle You will write four functions. I have provided the prototype for the first two functions listerd below. The remaining functions will be similar to the perimeter function because you will need to pass in the length and width. Each of the functions is described below . The displaytleading function will just contain one cout statenent that will display the phrase Rectangle Information Function Prototype: void cisplaxtieodinal . The calcPerimeter function will calculate and display the perimeter of the rectangle Function prototype: void salcBerimeterldouble I, double w The diagonal function will calculate and display the diagonal of the rectangle. The formula will require the sqrt function from the smath library, for example sqrt(16.0) is 4.0 . .The isSquare function will check to see if the rectangle is a square (if length and width are the same) it will display Your rectangle is a square else it will display Your rectangle is not a square. Here is an example of what your program should look like when it runs using 5 and 9 as test data. Your program should work with other values as well: Enter the length of a rectangle: Enter the width of a rectangle: 9 Rectangle Information The perimeter of the rectangle is 28.0 The diagonal of the rectangle is 10.3 Your rectangle is not a square Please note the following project requirements before you begin to write your program (all these requirements must be met in order to receive full credit) You must have documentation (comments) in the following locations: at the top of your program that show your name and a brief explanation of the program, prior to each function definition to provide a brief explanation of what the function will accomplish . . All code other than the interactive input statements (sout/ sio) that prompt the user should be in functions as described above All variables should be double and your precision should be set to 1

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

Question Who can establish a Keogh retirement plan?

Answered: 1 week ago