Question: please following the blank question. Use java program. E. (10 points) A car's miles-per-gallon per-gallon (MPG) can be calculated with the following formula: MPG Miles

please following the blank question. Use java program.
E. (10 points) A car's miles-per-gallon per-gallon (MPG) can be calculated with the following formula: MPG Miles DrivenGallons of Gas Used Complete the following pro used, then calculates and displays the MPG using JOptionPane gram which prompts the user to enter the miles driven and the gallons of gas //import the JoptionPane class public class MilesPerGallon public statie void main(String args) //declare variables //use the Joption Pane's input dialog boxes to input the miles driven //and gallons of gas used, and convert strings to numerical values //calculate MPG if both inputs are valid, print an error message otherwise. //format the result to 2 decimal places //and use the JopitonPane' s message dialog box to output the result ) //end main 1//end class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
