Problem Solving with C++ - MyProgrammingLab
Problem Solving with C++ - MyProgrammingLab
10th Edition
ISBN: 9780134522418
Author: SAVITCH
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 4, Problem 5PP

To maintain one’s body weight, an adult human needs to consume enough calories daily to (1) meet the basal metabolic rate (energy required to breathe, maintain body temperature, etc.), (2) account for physical activity such as exercise, and (3) account for the energy required to digest the food that is being eaten. For an adult that weighs P pounds, we can estimate these caloric requirements using the following formulas:

 A.    Basal metabolic rate: Calories required = 70 * (P/ 2.2)0.756

 B.    Physical activity: Calories required = 0.0385 * Intensity * P * Minutes

Here, Minutes is the number of minutes spent during the physical activity, and Intensity is a number that estimates the intensity of the activity. Here are some sample numbers for the range of values:

 
Running 10 mph: 17
Running 6 mph: 10
Basketball: 8
Walking 1 mph: 1

C.    Energy to digest food: calories required = TotalCaloriesConsumed * 0.1

 In other words, 10 percent of the calories we consume goes towards digestion.

 Write a function that computes the calories required for the basal metabolic rate, taking as input a parameter for the person’s weight. Write another function that computes the calories required for physical activity, taking as input parameters for the intensity, weight, and minutes spent exercising.

 Use these functions in a program that inputs a person’s weight, an estimate for the intensity of physical activity, the number of minutes spent performing the physical activity, and the number of calories in one serving of your favorite food. The program should then calculate and output how many servings of that food should be eaten per day to maintain the person’s current weight at the specified activity level. The computation should include the energy that is required to digest food.

 You can find estimates of the caloric content of many foods on the Web. For example, a double cheeseburger has approximately 1000 calories.

Blurred answer
Students have asked these similar questions
You have a five-quart jug, a three-quart jug, and an unlimited supply of water (butno measuring cups). How would you come up with exactly four quarts of water? Note that the jugs are oddly shaped, such that filling up exactly "half" of the jug would be impossible.
Assume that the speed of new computers costing a certain amount of money grows exponentially over time, with the speed doubling every 18 months. Suppose you need to run a very time consuming program and are allowed to buy a new computer costing a fixed amount on which to run the program. If you start now, the program will take 7 years to finish. How long should you delay buying the computer and starting the program so that it will finish in the shortest amount of time from now? Also, what will the shortest finishing time be?
A circle in the XY-coordinate system is specified by the center coordinates (x, y) and radius (r). Read the values for 2 circles- x1, y1, r1 for C1 and x2, y2, r2 for C2. (i) Determine whether the 2 circles intersect. To solve the problem it suffices to check if the distance between the 2 centers is lesser than the sum of radii of the 2 circles. (ii) Find the smallest circle that encloses the two circles and return its center coordinates and radius. programming language - c

Chapter 4 Solutions

Problem Solving with C++ - MyProgrammingLab

Ch. 4.3 - Write a function definition for a function called...Ch. 4.3 - Write a function definition for a function called...Ch. 4.3 - Write a function definition for a function isDigit...Ch. 4.3 - Write a function definition for a function...Ch. 4.4 - What is the purpose of the comment that...Ch. 4.4 - Prob. 16STECh. 4.4 - Prob. 17STECh. 4.4 - Carefully describe the process of program testing.Ch. 4.4 - Prob. 19STECh. 4.5 - If you use a variable in a function definition,...Ch. 4.5 - Suppose a function named Function1 has a variable...Ch. 4.5 - The following function is supposed to take as...Ch. 4.5 - Prob. 23STECh. 4.6 - Prob. 24STECh. 4.6 - Prob. 25STECh. 4.6 - Prob. 26STECh. 4.6 - Suppose you have two function definitions with the...Ch. 4.6 - This question has to do with the Programming...Ch. 4.6 - Prob. 29STECh. 4 - A liter is 0.264179 gallons. Write a program that...Ch. 4 - Modify your program from Practice Program 1 so...Ch. 4 - The price of stocks is sometimes given to the...Ch. 4 - Write a program to gauge the rate of inflation for...Ch. 4 - Enhance your program from the previous Practice...Ch. 4 - Write a function declaration for a function that...Ch. 4 - The gravitational attractive force between two...Ch. 4 - Prob. 8PCh. 4 - Prob. 9PCh. 4 - Write a program that computes the annual after-tax...Ch. 4 - Write a program that asks for the users height,...Ch. 4 - Modify your program from Programming Project 2 so...Ch. 4 - Write a program that outputs the lyrics for the...Ch. 4 - To maintain ones body weight, an adult human needs...Ch. 4 - You have invented a vending machine capable of...Ch. 4 - Your time machine is capable of going forward in...Ch. 4 - Do Programming Project 11 from Chapter 3 except...Ch. 4 - Your sports league uses the following lottery...Ch. 4 - Do Programming Project 14 from Chapter 3, the Edoc...
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Control Structure in Data Structure - Data Structures - Computer Science Class 12; Author: Ekeeda;https://www.youtube.com/watch?v=9FTw2pXLhv4;License: Standard YouTube License, CC-BY