Chapter 2 Project Project Name: Chpt2_Project Class Name: Chpt2_Project Write a Java program that calculates how many hours it will take to make a trip by 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 for the average speed (mph) of the car and the trip distance. Enter the average miles per hour (mph) for the car (this must be an integer): Enter the distance in miles the trip is (this must be a double): Output: The program should have this output (below is an example): The trip will take the following number of hours: Test data: Use the following data to test your program: The car averages 65 MPH and the trip is 400 miles. Take a screen shot of your program running in Eclipse and paste it into a Word document. It should look like the image below. C2 Project [Java Application] E:\Program Files\Java\jdk-14.0.2\bin\javaw.exe (Oct 21, 2020 9:28:27 AM-9:28:43 AM) Enter the average miles per houmph) for the car (this must be an integer): 65 Enter the distance in miles the trip is (this must be a double): 400 The trip will take the foll ing number of hours: 6.153846153846154 MacBook Pro 7. 6. 9:15 Q SEARCH & ASK 보 CHAT VX MATH SOLVER Step 5: STOP Step 2 Program package chpt2_project; import java.util.Scanner; public class Chpt2_Project { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("Enter the average miles per hour(mph) for the car(this must be in integer): "); int speed=sc.nextInt(); System.out.println("Enter the miles the trip is(this must be in double): "); double distance=sc.nextDouble(); double time=distance/speed3; System.out.println("The trip will take the following number of hours: "+time); } } Was this solution helpful? AA A bartleby.com
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Hello , okay so I sent a message asking for help on a question but I'm having a difficult time completing the assignment just because on eclipse it keeps saying error and I don't under why. I sent a picture of the assignment and I'll send you what you guys sent me already just so you don't have to repeat yourself.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 2 images