Question: a program using If statements and while loops (or do while loops). its for C++ and is done to work in visual studio. you can

2. Explain the purpose of the program to the user. Do this in a separate function. Request the type of conversion: MPG to L/100km (accept only L or I) or L/100km to MPG (accept M or m only). Continue to ask the user until the correct selection is made. Do this in main. 4. Request the rate (accept 10-60 MPG inclusive only) and (accept 3-30 1/100km inclusive only). Continue to ask the user until the rate is within the specified range. Do this in a separate function. 5. Do the conversion. Use imperial gallons (4.546 liters per gallon) in your calculations. Do this in a separate function, the function must be called from main. 6. Display the result. The output should include the input rate including units and the converted rate including units. The output must be displayed with an accuracy of two decimal places. Do this in a separate function. Ask the user if he/she would like to complete another conversion. If so (accept Y or y only), do not explain the purpose of the program again. The program should continue until the user would like to quit. Do this in main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
