Answered step by step
Verified Expert Solution
Link Copied!

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

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part I Lnai 8724

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448475, 978-3662448472

More Books

Students also viewed these Databases questions