Question: edit the code so when the user input N the program show Thank you! and end. CODE: #include #include #include using namespace std; void getdata(double
edit the code so when the user input N the program show "Thank you!" and end.
CODE:
#include
int main(){ char c; double a,b; double peri,area; do{ getdata(&a,&b); peri=getPerimeter(a,b); area=getArea(a,b); getPrint(peri,area); cout>c; }while(c=='Y');
}
void getdata(double *a,double *b){ cout>*a; cout>*b; } double getPerimeter(double a, double b){ double c,p; c=sqrt(pow(a,2)+pow(b,2)); p=a+b+c;
return p; } double getArea(double a, double b){ double ar=0.5*a*b; return ar; }
void getPrint(double peri,double area){ cout
sample output.
please include picture of the code and the output
csci>a.out Enter the length of side a: 3.0 Enter the length of side b: 4.0 The perimeter is 12.0. The area is 6.0. Do you want to calculate another set of data? Y Enter the length of side a: 2.0 Enter the length of side b: 7.0 The perimeter is 16.8. The area is 7.0. Do you want to calculate another set of data? N Thank you
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
