Westonci.ca connects you with experts who provide insightful answers to your questions. Join us today and start learning! Connect with professionals on our platform to receive accurate answers to your questions quickly and efficiently. Connect with a community of professionals ready to provide precise solutions to your questions quickly and accurately.

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:

Thanks for using our service. We aim to provide the most accurate answers for all your queries. Visit us again for more insights. We hope you found this helpful. Feel free to come back anytime for more accurate answers and updated information. Thank you for visiting Westonci.ca. Stay informed by coming back for more detailed answers.