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

  Software engineering and microprocessor systems

Software is required for a simple house burglar alarm system.

  How can a relation be organized in mass storage

How can a relation be organized in mass storage.

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  How to write a report on object-oriented systems

How to write a report on Object-Oriented Systems?

  Write a recursive implementation of euclids algorithm

Write a recursive implementation of Euclids algorithm

  Determine technology which has changed cafe,coffee shop

Determine technology which has changed cafe,coffee shop? Think things such as marketing, food preparation, inventory ordering or re-ordering, customer tracking, and more.

  Program on matrix

Program on matrix

  Generate the tables attach the primary key and foreign key

Generate the tables attach the primary key and foreign key

  Queries in relational algebra

Queries in relational algebra.

  Write a program that mimics a flop-turn-river of poker game

Write down a program that mimics a flop-turn-river of a poker game. I must have three buttons titled Deal, Shuffle and Start Over.

  What are disadvantages of low class

What are disadvantages of low class What are advantages of high value?

  Classify and discuss compensation potentially

Classify and discuss compensation potentially.

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