Problem Solving with C++ (10th Edition)
Problem Solving with C++ (10th Edition)
10th Edition
ISBN: 9780134448282
Author: Walter Savitch, Kenrick Mock
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
Context: Measuring Air Quality Levels of various air borne pollutants such as Nitrogen Monoxide (NO), Nitrogen Dioxide (NO2) and particulate matter (also called particle pollution) are all major contributors to the measure of overall air quality. For instance, NO2 is measured using micrograms in each cubic metre of air (㎍/m3). A microgram (㎍) is one millionth of a gram. A concentration of 1 ㎍/m3 means that one cubic metre of air contains one microgram of pollutant. To protect our health, the UK Government sets two air quality objectives for NO2 in their Air Quality Strategy The hourly objective, which is the concentration of NO2 in the air, averaged over a period of one hour. The annual objective, which is the concentration of NO2 in the air, averaged over a period of a year. The following table shows the colour encoding and the levels for Objective 1 above, the mean hourly ratio, adopted in the UK. Index 1 2 3 4 5 6 7 8 9 10 Band Low Low Low Moderate Moderate Moderate High…
Python Knapsack Problem: imagine you are carrying a knapsack with capacity to hold a total of weight C. You are selecting among n items with values A={a_1, a_2, ... , a_n} and associated weights W={w_1, w_2, ... , w_n}. Here the weights and values are all positive. You wish to maximize the total value of the items you select not exceeding the given weight capacity, example, maximize sum_{a in A} such that sum_{w in W} <= C.  Note that you can only select your items once.  Reformulate this as a bottom-up dynamic programming problem as follows. Define K_{i,j} as the highest possible value sum considering items 1 through i and total weight capacity j (j <= C). What is the base case i.e. K_{0,j} for all j and K_{i,0} for all i. What is the loop statement?
The mitotic index is a calculated value that represents the percentage of cells in a sample that are actively dividing. It involves counting the total number of cells present including those actively dividing or those in interphase, the total number of cells that are actively dividing (not including interphase), and then calculating what percentage of the total cells are actively dividing (the percentage undergoing mitosis).   The formula is: Mitotic index= # of cells in mitosis / # of cells in total x 100%     Use this formula to calculate the mitotic index for the diagram seen in Question 5. Show your calculations (you can use * for multiplication and / for division if you prefer) and indicate your final answer as a percentage rounded to the nearest tenth of a percentage (1 decimal place).   Note: The mitotic index seen in this simulation is much higher than you would see in a real tissue sample. The sample was simulated this way so that the counting and calculations would be easier…

Chapter 4 Solutions

Problem Solving with C++ (10th Edition)

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++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
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