C++ Programming problem The purpose of this program is to determine the amount o
ID: 3681701 • Letter: C
Question
C++ Programming problem
The purpose of this program is to determine the amount of cloth in square inches needed to make a certain kind of garment. Rather than using one big pile of main(). you need to use functions for these calculation that incorporate pass-by-value parameters. In addition, you need to include various int or double const declarations within your program. Finally, embed your program in a loop so that the calculation can be repeated as often as the user wishes. IN ORDER TO RECEIVE FULL CREDIT. YOU MUST DEFINE AND CALL FUNCTIONS AND PASS ARGUMENTS.Explanation / Answer
// Tailor Calculation
#include <iostream>
#include<conio>
using namespace std;
void calcualtePants()
{
int waist,height;
char pleaded;
char baggy;
char tryagain;
cout<<"Gimme you waist size in inches";
cin>>waist;
cout<<"Gimme you height size in inches";
cin>>height;
cout<<"Pleaded Front [Y/N]:";
cin>>pleaded;
cout<<"Baggy Look [Y/N]:";
cin>>baggy;
cout<<"try again [Y/N]:";
cin>>tryagain;
}
void calcualteShirts()
{
int waist,height;
char sleves;
char arms;
char tryagain;
cout<<"Gimme you waist size in inches";
cin>>waist;
cout<<"Gimme you height size in inches";
cin>>height;
cout<<"Long sleeves [Y/N]:";
cin>>sleves;
cout<<"Gimmes your arms length:";
cin>>arms;
cout<<"try again [Y/N]:";
cin>>tryagain;
}
void calcualteShots()
{
int waist,height;
char pockets;
char baggy;
char tryagain;
cout<<"Gimme you waist size in inches";
cin>>waist;
cout<<"Gimme you height size in inches";
cin>>height;
cout<<"Pockets [Y/N]?:";
cin>>pockets;
cout<<"try again [Y/N]:";
cin>>tryagain;
}
int main()
{
char input;
char tryagain;
cout<<"[P]ants or [S]hirts or Shor[T]s ";
cin>> input;
switch ( input ) {
case 'P':
calcualtePants();
break;
case 'S':
calcualteShirts();
break;
case 'T':
calcualteShorts();
break;
default:
cout<<"Try again?[Y/N]";
cin>>tryagain;
break;
}
cin.get();
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.