Question: Assignment purpose: simple i / o in C + + , simple math in C + + , simple loop, data types string, double, and

Assignment purpose: simple i/o in C++, simple math in C++, simple loop, data types string, double, and int, formatting
output in C++, predefined functions, programmer defined functions, call by reference and call by value.
Write a program that will calculate the area and perimeter of a triangle and the area and perimeter of a rectangle
The user should be able to continue to the calculate either the area and perimeter of a triangle OR the area and
perimeter/circumference of a circle until they enter a "Q" or "q" to QUIT
You must use the main function provided
YOU MAY NOT MAKE ANY MODIFICATIONS TO THE MAIN FUNCTION
You will implement the following void functions:
MenuChoices
ProcessChoice
You may add other programmer defined functions as needed
Example addition functions for the triangle and circle area and perimeter/circumference calculations
Use function prototypes (above the main function) and function definitions (below the main function)
BE SURE TO ADD COMMENTS TO THE FUNCTION PROTOTYPES
pre and post conditions and a brief description
BE SURE TO ADD COMMENTS TO THE FUNCTION DEFINITIONS
brief description
Here is the main function:
const double PI =3.14;
//Declaration/ Prototypes for your functions will go here
//Add pre and post conditions and a brief description
int main()
{
double area =0.0;
double perimeter;
string quit;
string nane;
cout "Welcome to the area and perimeter calculator, what is your first name? ";
cin \gg> nane;
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(3); //display the area to 3 decimal places
MenuChoices(name, quit);
ProcessChoice(quit, area, perimeter);
while (quit I="Q" && quit I="q")
{
cout "
The area (displayed in the main function) is " area endl;
cout "
The perimeter (displayed in the main function) is " perimeter endl;
MenuChoices(name, quit);
}
ProcessChoice(quit, area, perimeter);
cout "
Goodbye " name ", Have a great day! ";
return 0;
}
//function definitions will be placed BELOW the main function
#include
Assignment purpose: simple i / o in C + + ,

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 Programming Questions!