Question: Assignment purpose: simple i / o in C + + , simple math in C + + , simple loop, data types string, double, and
Assignment purpose: simple io in simple math in simple loop, data types string, double, and int, formatting
output in 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
perimetercircumference 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 perimetercircumference 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 ;
Declaration Prototypes for your functions will go here
Add pre and post conditions and a brief description
int main
double area ;
double perimeter;
string quit;
string nane;
cout "Welcome to the area and perimeter calculator, what is your first name? ;
cin gg nane;
cout.setfios::fixed;
cout.setfios::showpoint;
cout.precision; display the area to decimal places
MenuChoicesname quit;
ProcessChoicequit area, perimeter;
while quit IQ && quit Iq
cout
The area displayed in the main function is area endl;
cout
The perimeter displayed in the main function is perimeter endl;
MenuChoicesname quit;
ProcessChoicequit area, perimeter;
cout
Goodbye name Have a great day! ;
return ;
function definitions will be placed BELOW the main function
#include
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
