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

i have two question i got stuck in the middle of # 9 #9 write a program that ask

ID: 3617627 • Letter: I

Question

i have two question i got stuck in the middle of # 9

#9
write a program that asks for the user's height, weight, and age,and then computes clothing sizes according to the formulas.
Hat size = weight in pounds divided by height in inches and allthat multiplied by 2.9.

Jacket size ( chest in inches) = height times weight divided by 288and then adjusted by adding 1/8 of an inch for each 10 years overage 30. ( Note that adjustment only takes place after a full 10years. so, there is no adjustment for age 30 through 39, but 1/8 ofan inch is added for age 40.)

Waist in inches = weight divided by 5.7 and then adjusted by adding1/10 of an inch for each 2 years over age 28. ( Note that theadjustment only takes place after a full 2 years. so, there is noadjustment for age 29, but 1/10 of an inch is added for age30.)

use function for each calculation. ;your program should allow theuser to repeat this calculation as ofter as the user wishes.

#10
Modify your program from programming project 9 so that is alsocalculates the user's jacket and waist sizes after 10 years.

Explanation / Answer


#include<iostream> using namespace std; void hatsize(double, double); void jacsize(double,double, int); void waist(double,int); int main() { double height, weight; int age; char c='y'; while(c=='y'||c=='Y') { cout<<"Enter you Height: "; cin>>height; cout<<" Enter Weight: "; cin>>weight; cout<<" Enter age: "; cin>>age; hatsize(height,weight); jacsize(height,weight,age); waist(weight,age); cout<<" Are you like to Repeat (y for yes):"; cin>>c; } system("pause"); return 0; }
void hatsize(double h, double w) { cout<<"Hat Size: "<<((w/h)*2.9); }
void jacsize(double h, double w, int a) { double ag=0.0; double size=((h*w)/288);
while(a>30) { if(a%10==0) ag+=1/8; a/=10;
size+=ag; cout<<" Jacket Size: "<<size; } }
void waist(double w, int a) { double wst=w/5.7; double inc=0.0; while(a>28) { inc+=0.1; a-=2; } wst+=inc; cout<<" Waiste Size: "<<wst; }


#include<iostream> using namespace std; void hatsize(double, double); void jacsize(double,double, int); void waist(double,int); int main() { double height, weight; int age; char c='y'; while(c=='y'||c=='Y') { cout<<"Enter you Height: "; cin>>height; cout<<" Enter Weight: "; cin>>weight; cout<<" Enter age: "; cin>>age; hatsize(height,weight); jacsize(height,weight,age); waist(weight,age); cout<<" Are you like to Repeat (y for yes):"; cin>>c; } system("pause"); return 0; }
void hatsize(double h, double w) { cout<<"Hat Size: "<<((w/h)*2.9); }
void jacsize(double h, double w, int a) { double ag=0.0; double size=((h*w)/288);
while(a>30) { if(a%10==0) ag+=1/8; a/=10;
size+=ag; cout<<" Jacket Size: "<<size; } }
void waist(double w, int a) { double wst=w/5.7; double inc=0.0; while(a>28) { inc+=0.1; a-=2; } wst+=inc; cout<<" Waiste Size: "<<wst; }