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

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter7: Characters, Strings, And The Stringbuilder
Section: Chapter Questions
Problem 1DE
icon
Related questions
Question

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. 

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.
<terminated> 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.
Transcribed Image Text: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. <terminated> 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
Transcribed Image Text: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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT