Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Below are instructions for a c++ program, please help! Write one program that solves two problems about nutrition: calculate a restaurant bill and calculate your

Below are instructions for a c++ program, please help!

Write one program that solves two problems about nutrition: calculate a restaurant bill and calculate your body mass index (BMI). The steps are: 1) Restaurant bill - write code that calculates a restaurant bill given cost of food and tip percentage: a) Ask for and get the cost of food. Use data type double. b) Ask for and get the tip percentage. Use data type double. c) Internally, declare the tax rate: const double tax_rate = 0.0825. Do not ask for tax rate. d) Compute the total bill: food cost * tax rate + tip. What should the tip be? Based on food cost? Food cost and tax? You decide; provide comments. e) Print out the total bill. Test this. If you stop here, you have earned up to 10 points max.

2) Body Mass Index (BMI) write code that computes BMI. The formula is: BMI = (weight in pounds / (height in inches x height in inches) ) x 703 a) Ask for and get the required data. Use data type int. b) Calculate the BMI. For the result, use data type double. c) Print out the BMI. Test this. If you stop here, you have earned up to 14 points max. 3) Combine the two parts above into a menu. Prompt the user for whether they want to perform: a) amount of bill; or b) BMI. a) Ask for and get the option desired. Use data type char. b) if option a, compute amount of restaurant bill; if option b, calculate BMI Test this. If you stop here, you have earned up to 18 points max. 4) Loop the program, Add option q to quit. Loop until the user enters q to quit. a) Enter a loop. a) Ask for and get the option desired. b) if option a, compute amount of restaurant bill; if option b, calculate BMI; if option q, quit Test this. If you stop here, you have earned up to 20 points max.

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

Step: 3

blur-text-image

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

How good communication helps your career

Answered: 1 week ago