Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

rogrammer-Defined Functions, Call-by-Value, Multiple Files ab Assignment he assignment contains two parts. Basal metabolic rate. Study Observing Program Stack described here. As you program your

image text in transcribed
rogrammer-Defined Functions, Call-by-Value, Multiple Files ab Assignment he assignment contains two parts. Basal metabolic rate. Study "Observing Program Stack" described here. As you program your project below, demonstrate to the lab instructor observing variables local to several function frames. Create a project titled Labs_BMR with a single file titled bmr.cpp The program should calculate the person's Basal Metabolic Rate - the number of calories per day a person's body needs to function. Then, on the basis of calculated BMR, your program should output how many cupcakes a person can consume. A medium-size cupcake contains 131 calories. The BMR formula is as follows: for women: 655+(4.3weightinpounds)+(4.7heightininches)(4.7ageinyears for men: 66+(6.3weightinpounds)+(12.9heightininches)(6.8ageinyears Depending on gender, BMR should be calculated by functions bmrwomen () and bmrMen () that both accept three parameters: "weight in pounds", "height in inches" and "age in years" and return the BMR. Note that the BMR has a fractional part. The main function should prompt the user for her gender, weight, height and age; compute the BMR and the number of cupcakes that can be consumed per day; and then output both the BMR and the number cupcakes. The number of cupcakes is: BMR divided by the number of calories in a cupcakes. Fractional number of cupcakes can be dropped. The number of calories per cupcake (131) should be put in a named constant. On the basis of the user's gender, maing function should decide whether to invoke bmrwomen() or bmrMen (). The user should input her height in feet and inches. The main () function should compute the total number of inches (one foot has 12 inches) and pass it to the bmr functions. Make sure to use the bmr function prototypes and put the function definitions below the main function definition

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago