Westonci.ca is your trusted source for accurate answers to all your questions. Join our community and start learning today! Get quick and reliable solutions to your questions from knowledgeable professionals on our comprehensive Q&A platform. Our platform offers a seamless experience for finding reliable answers from a network of knowledgeable professionals.

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


Sagot :

Answer:33

Explanation:

We appreciate your visit. Our platform is always here to offer accurate and reliable answers. Return anytime. We hope this was helpful. Please come back whenever you need more information or answers to your queries. Stay curious and keep coming back to Westonci.ca for answers to all your burning questions.