Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 side lengths of a rectangle and computes the area, perimeter, and the diagonal of the rectangle using four 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 Rectangleh 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
Prompt for side length one, then prompt for side length two in main
Call a function that computes the area of the rectangle and returns the value
Call another function that computes the perimeter and returns the value
Call another function that computes the diagonal and returns the value
Call a void output function that displays all of the values with descriptions as shown below
with precision set to places. This function does not return a value.
Function names should describe what the function does ex: getperimeter, displayoutput, 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 Rectangle program functions and multifile programs
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started