Computers and Technology

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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:00, chuchi24
Robots with telescoping arms are sometimes used to perform tasks (e. g., welding or placing screws) where access may be difficult for other robotic types. during a test run, a robot arm is programmed to extend according to the relationship r = 3 + 0.5cos(4θ) and the arm rotates according to the relationship θ=−π4t2+πt , where r is in feet, θ is in radians, and t is in seconds. use a computer program to plot the path of tip a in x and y coordinates for 0 ≤ t ≤ 4s.
Answers: 2
image
Computers and Technology, 22.06.2019 10:00, hailee232
What is a society that has moved to the internet rather than relying on physical media called
Answers: 2
image
Computers and Technology, 22.06.2019 15:00, vladutraileanu7599
Which of the following has not been attributed at least in part to social media a. drug addiction b. depression c. kidnapping d. murder
Answers: 2
image
Computers and Technology, 22.06.2019 15:30, gudon986732
When creating a budget, log fixed expenses before income. after income. after savings. at the top.
Answers: 1
Do you know the correct answer?
Driving is expensive. Write a program with two inputs, a car's miles/gallon and the cost of gas/gall...

Questions in other subjects:

Konu
History, 22.07.2019 02:10
Konu
Mathematics, 22.07.2019 02:10