Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 # 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 Create a new file in your IDE or text editor Create the shell for your first program by entering:public class Mileagepublic static void mainString args Add your declaration and code here. Save the file as Mileage.java Translate the algorithm below into Java code. Dont forget to declare variablesbefore they are used. Each variable must be one word only no spacesPrint 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 labels Compile the program and debug, repeating until it compiles successfully 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started