subject

Driving is expensive. Write a program with two inputs, a car's miles/gallon and the cost of gas/gallon both represented as double variables, and output the total drive cost for 10 miles, 50 miles, and 400 miles, all on the same line, each separated by a single space. Output each floating-point value with two digits after the decimal point, which can be achieved by executing the command
cout << fixed << setprecision(2); once before all other cout statements. That is done only once in the code before any cout stamtent.

Ps:(when i run the program it says this-
Enter miles per Gallon:
Gas cost for ten miles :-nan
Gas cost for fifty miles :-nan
Gas cost for four hundred miles:-nan

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 05:30
Sally is editing her science report about living things. she needs to copy a paragraph from her original report. order the steps sally needs to do to copy the text to her new document.
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Jace needs to answer a question on square roots to win a quiz. how can he use a spreadsheet to find the square root of 786? a. use the functions round and count b. create a table and chart c. use the function sqrt d. use the function now
Answers: 3
question
Computers and Technology, 23.06.2019 22:00
Jackson, who works in the finance department of a company, is holding a seminar for other employees on how to file taxes. only three employees sign up to attend the seminar. which device can he use to share his presentation with a group of three employees?
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Guys do you know sh27 cause he hacked me : ( pidgegunderson my old user
Answers: 2
You know the right answer?
Driving is expensive. Write a program with two inputs, a car's miles/gallon and the cost of gas/gall...
Questions
question
Computers and Technology, 03.09.2019 03:10
Questions on the website: 13722367