Question: Create a C++ program to determine how much cloth in square inches is needed to make a certain type of garment. You should base your

Create a C++ program to determine how much cloth in square inches is needed to make a certain type of garment. You should base your calculations on the following table:

Pants Shirts Shorts
2 1/2 square inch per waist size inch of the person being fitted 2 3/8 square inch per waist size inch of the person being fitted 1 3/10 square inch per waist size inch of the person being fitted
1/2 square inch per height inch of the person being fitted 4/9 square inch per height inch of the person being fitted 1/4 square inch per height inch of the person being fitted
1/10 square inch per waist size inch of the person being fitted, if pleaded front is desired 2 4/5 square inch per arms length inch of the person being fitted, if long sleeves are desired If pockets are desired, add an extra 15% to the fabric amount calculated so far
If baggy look is desired, add an extra 10% to the fabric amount calculated so far

Rather than putting all your code in main(), use functions to perform the calculation. Embed your program in a loop so that the calculation can be repeated multiple times. Use constants to hold the literal values in the above table, for example:

const double PANTS_WAIST_FACTOR = 2 + 1.0/2;

Tailor Fabric Calculator: Whaddya want? [P]ants 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/N]: Y Baggy Look? [Y/N]: N For your pants, you'll need 114 square inches of fabric! Try again? [Y/N]: Y

Tailor Fabric Calculator: Whaddya want? [P]ants or [S]hirts or shor[T]s: S Gimme your waist size in inches: 32 Gimme your height size in inches: 50 Long sleeves? [Y/N]: Y Gimme your arms length in inches: 25 For your shirts, you'll need 168.2222 square inches of fabric! Try again? [Y/N]: Y

Tailor Fabric Calculator: Whaddya want? [P]ants or [S]hirts 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'll need 73.025 square inches of fabric! Try again? [Y/N]: N

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