Display the miles per gallon obtained for each tankful

Assignment Help Computer Engineering
Reference no: EM132946

Question

Gas Mileage Drivers are concerned with mileage obtained by their automobiles. One driver has kept track of some tankfuls of gasoline by recording miles driven and gallons used for each tankful. Expand a C++ program that uses a as statement to input the miles driven and gallons used for each tankful. Program must calculate and display the miles per gallon obtained for each tankful and print combined miles per gallon obtained for all tankfuls up to this point.

Enter miles driven (-1 to quit): 287
Enter gallons used: 13
MPG this tankful: 22.076923
Total MPG: 22.076923
Enter miles driven (-1 to quit): 200
Enter gallons used: 10
MPG this tankful: 20.000000
Total MPG: 21.173913
Enter miles driven (-1 to quit): 120
Enter gallons used: 5
MPG this tankful: 24.000000
Total MPG: 21.678571
Enter miles driven (-1 to quit): -1

Reference no: EM132946

Questions Cloud

Suggest all sources using APA style : Suggest all sources using APA style
Comment-essential to establish only target market objectives : In setting prices, it is essential to establish only target market objectives. Comment If a company is to respond accurately to price changes, it must thoroughly understand its competitors. Discuss
Write down a css rule : Write down a CSS rule
Purpose a flexible budget performance report : Purpose a flexible budget performance report that indicates any variances between budgeted results and actual results.
Display the miles per gallon obtained for each tankful : Display the miles per gallon obtained for each tankful
What do you understand by the term branding : What do you understand by the term branding The organisational brand defines how the organization best meets its customers' needs in unique and compelling ways. Discuss the statement with reference to relevant brand indentities
What is bobs private key : What is Bob's private key?
Computation of basic eps for the year 2002 : What number of shares can be used in the computation of basic EPS for the year 2002?
A function to see if one list is a shallow copy of other : A function to see if one list is a shallow copy of other

Reviews

Write a Review

Computer Engineering Questions & Answers

  What profit do you see with partitioned view

Explain your idea for a database along with your thoughts for a partitioned view. 1. How will you use this partitioned view?

  How to set up or recover cybersecurity

How to set up or recover cybersecurity.

  Explore paper on vmware security

Explore paper on VMware Security

  What changes have to be made to accept $ and cents

What changes have to be made to accept $ and cents

  Classify enterprise wide system in hospitals today

Classify enterprise wide system in hospitals today. Classify all external system that interface with the facility or organization.

  Write a recursive implementation of euclids algorithm

Write a recursive implementation of Euclids algorithm

  Describes a function named insidecircle

Describes a function named insideCircle

  What is a backup strategy or active directory?

What is a backup strategy or Active Directory? The small business that you created new domain controllers for now wants you to develop a backup and recovery plan for Active Directory.

  Calculate the output value of problem

Design a program that reads in a text file with drawing commands and then outputs a bitmap with all the items drawn correctly

  How to run and modify marie program

How to run and modify marie program Include a decision before storing and outputing result. If  value of the result is not positive (so zero or negative), set  Result value to the value ZERO (0)

  Modify compound interest program

Modify compound interest program

  Produce two random integer numbers between 1 and 200

Produce two random integer numbers between 1 and 200.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd