Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how can I do #6 using c++ 6. (Program) a. Write, compile, and run a C++ program that displays the following prompts: Enter the miles

how can I do #6 using c++

image text in transcribed

6. (Program) a. Write, compile, and run a C++ program that displays the following prompts: Enter the miles driven: Enter the gallons of gas used: After each prompt is displayed, your program should use a cin statement to accept data from the keyboard for the displayed prompt. After the number for gallons of gas used has beern entered, your program should calculate and display the miles per gallon (mpg). This value should be calculated with the formula miles per gallon- miles I gallons used and displayed in an output message. Verify your program by using the following test data: Test data set 1: miles 276, gas 10 gallons Test data set 2: miles 200, gas 15.5 gallons After finishing your verification, use your program to complete the following chart. (Make sure to convert the miles driven to kilometers driven, convert gallons used to liters used, and then compute the kilometers per liter. There are 1.61 kilometers per mile and 4.54609 liters per gallon.) Km Driven Liters Used Km/L Miles Driven Gallons Used Mpg 250 275 312 296 16.00 18.00 19.54 b. For the program written for Exercise 6a, determine how many verification runs are required to make sure the program is working correctly, and give a reason to support your

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

What are typical interest rates for commercial paper?

Answered: 1 week ago

Question

Is hedge accounting permitted for a delta-neutral hedging strategy?

Answered: 1 week ago

Question

Identify three types of physicians and their roles in health care.

Answered: 1 week ago

Question

Compare the types of managed care organizations (MCOs).

Answered: 1 week ago