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
  • Please write this code in C++ Object-Oriented Programming, specify which files are .h, and .cpp, and...

    Please write this code in C++ Object-Oriented Programming, specify which files are .h, and .cpp, and please add comments for the whole code. Include a class diagrams, and explain the approach you used for the project and how you implemented that, briefly in a few sentences. Please note the following: -Names chosen for classes, functions, and variables should effectively convey the purpose and meaning of the named entity. - Code duplication should be avoided by factoring out common code into...

  • Please use APA format and references please Ethical Reasoning Assignment You will use your analysis of...

    Please use APA format and references please Ethical Reasoning Assignment You will use your analysis of the case study as a foundation for an ethical discussion. This discussion will provide you an opportunity to apply ethical reasoning to an ethical issue within the field of pediatric nursing: The use of growth hormones. You will also have an opportunity to demonstrate your writing skills. Your assignment should include a title and a reference page. Your assignment should be double spaced using...

  • C Programming write two functions, similar to what you see in the sample program. The first will ask the user to enter some information (I have included the type in parentheses) First Name (char[]) L...

    C Programming write two functions, similar to what you see in the sample program. The first will ask the user to enter some information (I have included the type in parentheses) First Name (char[]) Last Name (char[]) Age (int) Height in Inches (double) Weight in Pounds (double) You will use pass-by-reference to modify the values of the arguments passed in from the main(). Remember that arrays require no special notation, as they are passed by reference automatically, but the other...

  • Will facebook be able to have a successful business model without invading privacy? explain your answer?...

    Will facebook be able to have a successful business model without invading privacy? explain your answer? could facebook take any measures to make this possible? BUSINESS PROBLEM-SOLVING CASE Facebook Privacy: Your Life for Sale Facebook has quickly morphed from a small, niche haps most obviously. Facebook allows you to keep in networking site for mostly Ivy League college stu- touch with your friends, relatives, local restaurants, dents into a publicly traded company with a market and, in short, just about...

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