Question

interest payment. Your program should use at least two function definitions and should allow the user to repeat this calculation as often as the user wishes. 2. Write a program that asks for the users height, weight, and age, and then computes clothing sizes according to the formulas: Hat size weight in pounds divided by height in inches and all that multiplied by 2.9. Jacket size (chest in inches) - height times weight divided by 288 and then adjusted by adding 1/8 of an inch for each 10 years over age 30. (Note that the adjustment only takes place after a full 10 years. So, there is no adjustment for ages 30 through 39, but 1/8 of an inch is added for age 40.) Waist in inches weight divided by 5.7 and then adjusted by adding 1/10 of an inch for each 2 years over age 28. (Note that the adjustment only takes place after a full 2 years. So, there is no adjustment for age 29, but 1/10 of an inch is added for age 30.) Use functions for each calculation. Your program should allow the user to repeat this calculation as often as the user wishes. 3. Modify your program from Programming Project 2 so that it also calculates the users jacket and waist sizes after 10 years. 4 Wnte a progra m that outputs the lyrics for the song “Ninety-Nine Bottles

IN C++ PLEASE

0 0
Add a comment Improve this question Transcribed image text
Answer #1

HOPE THIS HELPS

PLEASE RATE THUMBSUP

ANSWER:

CODE:

CODE:

#include<stdio.h> // headert file
float height,weight; // required varaibles where values from user should be stored
int age,ch;
main(){ // main function
do{
printf("Enter height of the person in pounds\n");
scanf("%f",&height); // getting user height
printf("Enter weight of the person in inches\n");
scanf("%f",&weight); // getting user weight
printf("Enter age of the person\n");
scanf("%d",&age); // getting user age
printf("\nMeasures of that person are: \n");
hat_size(); // calling required functions
jacket_size();
waist_size();
printf("\n\n Want to know measures of another person 1-YES, 2-N0\n");
scanf("%d",&ch); // asking user for another persion measures
}while(ch==1); // if yes while will be true
}
hat_size(){ // function to calculate hat size
printf("Hat size: %f\n",(weight/height)*2.9);
}
jacket_size(){ // function to calculate jacket size
float a1=0.0; // variable for adding 1/8
int a=age;
while(a>=40){ // adding only if age > = 40 for every 10 years
a1=a1+((float)1/(float)8); // add 1/8 to variable a1
a=a-10; // untill age becomes 40 , mentioned in while condition
}
printf("Jacket size: %f inches\n",(weight*height)/288+a1);
}
waist_size(){ // function to calculate waist size
float a1=0.0; // variable for adding 1/10
int a=age;
if(a>28 && a%2==0) // if age is above 28 and even age
a1=((float)1/(float)10)*((a-28)/2); // add 1/10 for every 2 years from 30
printf("Waist size: %f inches\n",(weight/5.7)+a1);
}

OUTPUT:

Enter height of the person in pounds 10 Enter weight of the person in inches 20 Enter age of the person 40 Measures of that p

Add a comment
Know the answer?
Add Answer to:
IN C++ PLEASE interest payment. Your program should use at least two function definitions and should...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT