Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ programming problem C++ Problem The purpose of this program is to determine

ID: 3681672 • Letter: C

Question

C++ programming problem

C++ 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 param- eters. 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. You should base your calculations on the following table: Shirts Pants Shorts 13/10 square inch per waist 1 1/2 square inch per waist size 2/3 square inch per waist size inch size inch of the person being inch of the person being fitted of the person being fitted fitted 1/2 square inch per height 419 square inch per height inch of 3 3/8 square inch per height inch inch of the person being the person being fitted the person being fitted fitted 1/10 square inch per waist size 1 1/2 square inch per arms length If pockets are desired, add inch of the person being fitted, if inch of the person being fitted, if an extra 5% to the fabric pleaded front is desired long sleeves are desired amount calculated so far f baggy look is desired, add an extra 15% to the fabric amount calculated so far A number of different program dialogues describe the program l am looking for Output example Tailor Fabric Calculator: Whaddya want? CPjants or [S]hirts or shor[T]s: P Gimme your waist size in inches: 30 Gimme your height size in inches: 72 Pleaded front? [Y/ Y Baggy Look? [Y/N]: N For your pants, you need 79.9968 square inches of fabric Try again? [Y/N]: Y Tailor Fabric Calculator: Whaddya want? [Plants or [S]hirts or shorlTJs: S Gimme your waist size in inches: 32 Gimme your height size in inches: 50 Long sleeves? [Y/Nj: Y Gimme your arms length in inches: 25 For your shirts, you need 227.5812 square inches of fabric Try again? [Y/ Y Tailor Fabric Calculator Whaddya want? [PJants or ISJhirts or shor[T]s: T Gimme your waist size in inches: 35 Gimme your height size in inches: 72 Pockets? [Y/N]: Y For your shorts, you need 85.575 square inches of fabric Try again? [Y/ NJ: N

Explanation / Answer

Following is the actual code but conversions are little bit differet : executed unde codeblocks IDE

#include <iostream>
#include <iomanip>

using namespace std;
double waistInches(int waist)
{
return waist;
}
double baggyedDesired(double fAmount)
{
return fAmount;
}
double heightInches(int h)
{
return h;
}
double pleadedFrontDesired(int fAmount)
{

return fAmount;
}
double longLeaves(double l)
{
return l;
}
double pocket(double p)
{
return p;
}
int main()
{
int waist=0,height=0;
double totalWaist,totalHeight;
char ch,input;
double extraWaist,fabricAmount;
do{
cout << "Tailor Fabric Calculator : ";
cout << "what do you want [P]ants or [S]hirts or Shor[T]s :";
cin >> ch;
cout << "Give me your waist size in inches :";
cin >>waist;
cout << "Give me your height in inches :";
cin >>height;

switch(ch)
{
case 'P': totalWaist=waistInches(waist*3/2);
cout << "total waist size = "<< totalWaist<<endl;
totalHeight=heightInches(height*4/9);
cout << "total height size = "<< totalHeight<<endl;
cout << "Pleaded Front [Y/N] :";
cin >> input;
if(input == 'Y' || input == 'y')
{
extraWaist = pleadedFrontDesired(waist*1/10);
cout << "extra waist = "<< extraWaist<<endl;
}
cout << "Baggy Look [Y/N] :";
cin >> input;
if(input == 'Y' || input == 'y')
{
extraWaist=pleadedFrontDesired(extraWaist*(15/100)+(extraWaist));
}
fabricAmount=(totalHeight+totalWaist+extraWaist);
cout << "For your pants you will need " << fabricAmount << " Square inches of Fabric ";
break;
case 'S': totalWaist=waistInches(waist*2/3);
totalHeight=heightInches(height*27/8);
cout << "Long Leaves [Y/N] :";
cin >> input;
if(input == 'Y' || input == 'y')
{
extraWaist = longLeaves(waist*3/2);
cout << "extra waist = "<< extraWaist<<endl;
}


fabricAmount=(totalHeight+totalWaist+extraWaist);
cout << "For your pants you will need " << fabricAmount << " Square inches of Fabric ";
break;
case 'T': totalWaist=waistInches(waist*11/10);
totalHeight=heightInches(height*1/2);
cout << "Pocket Needed [Y/N] :";
cin >> input;
if(input == 'Y' || input == 'y')
{
fabricAmount=totalHeight+totalWaist;
fabricAmount=fabricAmount+pocket(15/100*fabricAmount);

}


cout << "For your pants you will need " << fabricAmount << " Square inches of Fabric ";
break;
default: cout << "Give Proper input ";

}
cout << "Do you want to continue [Y/N] :" ;
cin >> input;
}while(input != 'N' || input != 'n');

return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote