Repeat
a. Sedentary
b. Somewhat active (exercise occasionally)
c. Active (exercise 3–4 days per week)
d. Highly active (exercise every day)
If the user answers “Sedentary,” then increase the calculated BMR by 20
percent. If the user answers “Somewhat active,” then increase the
calculated BMR by 30 percent. If the user answers “Active,” then increase
the calculated BMR by 40 percent. Finally, if the user answers “Highly
active,” then increase the calculated BMR by 50 percent. Output the
number of chocolate bars based on the new BMR value.
13. The Harris–Benedict equation estimates the number of calories your body needs to maintain your weight if you do no exercise. This is called your basal metabolic rate, or BMR.
The formula for the calories needed for a woman to maintain her weight is BMR=655+(4.3×weight in pounds)+(4.7×height in inches)−(4.7×age in years) The formula for the calories needed for a man to maintain his weight is BMR=66+(6.3×weight in pounds)+(12.9×height in inches)−(6.8×age in years) A typical chocolate bar will contain around 230 calories. Write a program that allows the user to input his or her weight in pounds, height in inches, age in years, and the character M for male and F for female. The program should then output the number of chocolate bars that should be consumed to maintain one’s weight for the appropriate sex of the specified weight, height, and age.
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Problem Solving with C++ (9th Edition)
Additional Engineering Textbook Solutions
C++ How to Program (10th Edition)
Programming in C
Concepts Of Programming Languages
Java How To Program (Early Objects)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Java: An Introduction to Problem Solving and Programming (7th Edition)
- create a program in c that mimics the following dice game: A player rolls two dice. Each die has six faces. These faces contain 1, 2, 3, 4, 5, and 6 spots. After the dice have come to rest, the sum of the spots on the two upward faces is calculated. If the sum is 7 or 11 on the first throw, the player wins. If the sum is 2, 3, or 12 on the first throw the player loses. If the sum is 4, 5, 6, 8, 9, or 10 on the first throw, then the player must conitue to roll again until they roll that same number again in order to win. The player loses by rolling a 7 before making the point. Write a program in c that implements this game according to the above rules. The game should allow for wagering. This means that you need to prompt that user for an initial bank balance from which wagers will be added or subtracted. Before each roll prompt the user for a wager.arrow_forwardPYTHON PROGRAMMINGarrow_forwardTASK " Write a program that grades students' exam. The exam has 20 multiple choice questions. Here are the correct answers: 1- A 6- B 11-C 16- D 2- A 7- B 12- C 17- D 3- А 8- В 13-С 18- D 4- А 9- В 14- С 19- D 5- A 10-B 15- C 20- D "A student must correctly answer 15 of the 20 questions to pass the exam. " Write a class named StudentExam that holds the correct answers to the exam in an array. TASK (CONT.) " The class should also have an array that holds the student's answers. The class also should have the following methods: I passed. Returns true if the student passed the exam, or false if the student failed " totalCorrect. Returns the total number of correctly answered questions I totallncorrect. Returns the total number of incorrectly answered questions " questionsMissed. An int array containing the question numbers of the questions that the student missed. 1 On another class, ask the student to enter his name, take his answers and display the results returned from the StudentExam…arrow_forward
- Write a simple payroll program that will display employee’s information. Refer to the UMLClass Diagram for the names of the variable and method. This should be the sequence of theprogram upon execution:a. Prompt the user to input the name of the employee.b. Prompt the user to select between full time and part time by pressing either F (fulltime) or P (part time).c. If F is pressed, ask the user to type his monthly salary. Then, display his name andmonthly salaray.d. If P is pressed, ask the user to type his hourly rate and hours worked separated by aspace. Then display his name and wage.arrow_forwardPlease answer in matlab code.arrow_forwardUse C language in creating this programarrow_forward
- I need a correct answer in problem 5. Base your answer in the example I give. Thanks!arrow_forwardQuestion 2: As a python programmer for an educational institution you are instructed to write a program to simulate the grades for 5 subject areas and display the grade for each based on the following guidelines: Take in the marks of 5 subjects from the user and store it in different variables. 2. Find the average of the marks. 3. Use an else condition to decide the grade based on the average of the marks. 4. Print the Words "Successful Grad Earned" if the student has passed, if the student has failed print the Words" Re-Take Exam" 5. Exit A. Write an algorithm to represent the steps for this program B: Write a program in python to execute the guidelines presented above C. Draw a detailed flowchart to represent the programarrow_forwardA student makes the following argument. if I receive a good grade, the instructor teaches well. I didn't receive a good grade. Therefore, the instructor didn't teach well. is the student's argument valid? Let A be the statement, "I receive a good grade" and B be the statement, " the instructor teaches well." Then, rewrite the above paragraph using A and B.arrow_forward
- 2. Write a program that determines a student's grade. The program will read three scores and determine the grade based on the following rules: -if the average score >=90% and grade=A -if the average score >= 70% and grade=B -if the average score>=50% and grade=C -if the average scoregrade=Farrow_forward1.Write a program to determine whether a number is a deficient number or not. A number is deficient number as the sum of its factors (1+3+5+15=24) is less than 30 (double of 15). On the other hand, 24 is not a deficient number. Because the sum of the factors of 24 (1,2,3,4,6,8,12,24) is 60 which is larger than double of 24. 2.Manually trace(show the values of all the variables in each step) the following code segment. int n=5,sum=0,i,a=3,sign=1; for(i=1;iarrow_forwardAn Internet service provider has three different subscription packages for its customers: Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program that calculates a customer’s monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should then display the total charges. Requirements: Please include a Flowchart and the pseudocode for your program and use Visual Basicarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning