1. Engineering
  2. Computer Science
  3. project name chpt2project class name chpt2project write a java program...

Question: project name chpt2project class name chpt2project write a java program...

Question details

Project Name: Chpt2_Project

Class Name: Chpt2_Project

Write a Java program that computes total distance traveled by a car.

Step 1. Create an algorithm for the program (either a flowchart or pseudocode). You will have to submit the algorithm so make sure it is legible if drawn by hand.

Step 2. Create a program in Eclipse that does the following.

Inputs: The program must prompt the user to enter two inputs: 1) how many gallons the gas tank will hold; and 2) the gas mileage, i.e. miles per gallon, the car gets.

Enter how many gallons the gas tank holds (must be less than 25):

Enter the miles per gallon the car gets (must be less than 30 MPG):

Output: The program should have this output (below is an example):

The maximum distance the car can travel is:

Test data: Use the following data to test your program:

                The car has a 22-gallon gas tank and gets 27 miles to the gallon.

R Problems @ Javadoc Ea Declaration.貝Console X. Data Hierarchy くterminated> C2 Project JavaApplication]CAP grS File Javay e1.80-14 binjavaw exe (Oct 18, 2017, 12:49:58 PM) Enter how many gallons the gas tak Enter the miles per gallon the must be less than 25): 22 s (must be less than 30 MPG): 27 The maximum distance the travel is: 594

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution