Question: Create a new project in Code::Blocks and write a program that prompts the user for the two ( 2 ) side lengths of a rectangle

Create a new project in Code::Blocks and write a program that prompts the user for the two (2) side lengths of a rectangle and computes the area, perimeter, and the diagonal of the rectangle using four (4) functions that are located in a header file. Input should be validated so it does not accept negative or zero values.
The program will use two files. Main will contain the prompts for the user and calls to the functions. The header file (Rectangle.h) will contain the required functions. Output must be from the output function.
Four functions are required (and will be in the separate header file), and #include .
1. Prompt for side length one, then prompt for side length two in main
2. Call a function that computes the area of the rectangle and returns the value
3. Call another function that computes the perimeter and returns the value
4. Call another function that computes the diagonal and returns the value
5. Call a void output function that displays all of the values with descriptions as shown below
with precision set to 2 places. This function does not return a value.
Function names should describe what the function does (ex: get_perimeter, display_output, etc.).
The code should be neat, sectioned appropriately, and be easy to follow and see the flow of control. Grading will include additional scrutiny and meeting all requirements of the Lab. Lab 5- Rectangle program (functions and multi-file programs)

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!