Question: C++ using Visual Studio please Assignment Calculating fuel economy. This program will use exceptions and stream errors to make a robust application that gets the
Assignment Calculating fuel economy. This program will use exceptions and stream errors to make a robust application that gets the number of miles and gallons each time the user fuels their car. It will put those values into vectors. economy. 4. Once the user wants to quit enter values, it will calculate the fuel a. Create GetMiles() function that returns double. If there is a stream error, then throw a runtime_error with the message Invalid input received, you must enter a decimal number. Don't forget to clear the error and ignore all characters until the end of the stream. i. li. If the value is less then or equal to zero, then throw a runtime_error with the ii. Otherwise, return the miles the user entered i. If there is a stream error, then throw a runtime error w message. Miles cannot be less than e. b. Create GetGallons() function that returns double. th the message Invalio input received, you must enter a decimal number. Don't forget to clear the error and ignore all characters until the end of the stream. li If the value is less than or equal to zero, then throw a runtime_error with the message. Gallons cannot be less than ii. Otherwise, return the miles the user entered c. Create GetMPG(vector
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
