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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education