Question: IN C#: Write a program that asks the user to enter the miles driven on a trip and the number of gallons used. The program
IN C#: Write a program that asks the user to enter the miles driven on a trip and the number of gallons used. The program then calculates the miles per gallon(mpg) the vehicle had during the trip. The program should NOT crash if the user input is not in the format of a proper number(double). Instead, display the following message:
The data entered is not in the format of a number. Please re-enter your data.
The program should repeatedly ask the user for numbers until valid data has been entered. Once the data is validated, the mpg should be calculated and outputted
THIS NEEDS TO BE DONE IN C#!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
