Question: Task # 5 Create a program from scratchIn this task the student will create a new program that calculates gas mileage in miles pergallon. The

Task #5 Create a program from scratchIn this task the student will create a new program that calculates gas mileage in miles pergallon. The student will use string expressions, assignment statements, input and outputstatements to communicate with the user.1. Create a new file in your IDE or text editor.2. Create the shell for your first program by entering:public class Mileage{public static void main(String[] args){// Add your declaration and code here.}}3. Save the file as Mileage.java.4. Translate the algorithm below into Java code. Dont forget to declare variablesbefore they are used. Each variable must be one word only (no spaces).Print a line indicating this program will calculate mileagePrint prompt to user asking for miles drivenRead in miles drivenPrint prompt to user asking for gallons usedRead in gallons usedCalculate miles per gallon by dividing miles driven by gallons usedPrint miles per gallon along with appropriate labels5. Compile the program and debug, repeating until it compiles successfully.6. Run the program and test it using the following sets of data and record the results:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!