Instructions 1. Use JGRASP to write, compile and run all code. 2. Save the compiled, error-free file as ClassExercise2.java.. (i.e. ClassExerciseMJ.java) 3. Be sure to use proper programming techniques such as line spacing, indentation and comments before each section describing each section. 4. Create a Java program "Road Trip Planner" which includes the following: a) Ask the user to enter the total driving distance in miles. b) Ask the user to enter driving distance in miles per hour. c) Ask the user to enter the total hours of the road trip. d) Display the estimated travel time in hours with two digits after the decimal point. Use Math.round() for more accuracy. e) Display the number hours and minutes that the user will stay at the destination. Use a constant to define the number of minutes per hour. (i.e. MINS_PER_HR) For the total number of minutes, consider only its integer part. (i.e. convert the total minutes to an integer) Make sure to match the EXACT output. Sample Output MEnter the driving distance: 500 MEnter the driving distance per hour: 55.5 4MEnter the number of hours for this trip: 72 MM&M MM MYour estimated travel time will be 9.01 hours. MM MYou will have 62 hours, and 59 minutes to stay at the destination.
Instructions 1. Use JGRASP to write, compile and run all code. 2. Save the compiled, error-free file as ClassExercise2.java.. (i.e. ClassExerciseMJ.java) 3. Be sure to use proper programming techniques such as line spacing, indentation and comments before each section describing each section. 4. Create a Java program "Road Trip Planner" which includes the following: a) Ask the user to enter the total driving distance in miles. b) Ask the user to enter driving distance in miles per hour. c) Ask the user to enter the total hours of the road trip. d) Display the estimated travel time in hours with two digits after the decimal point. Use Math.round() for more accuracy. e) Display the number hours and minutes that the user will stay at the destination. Use a constant to define the number of minutes per hour. (i.e. MINS_PER_HR) For the total number of minutes, consider only its integer part. (i.e. convert the total minutes to an integer) Make sure to match the EXACT output. Sample Output MEnter the driving distance: 500 MEnter the driving distance per hour: 55.5 4MEnter the number of hours for this trip: 72 MM&M MM MYour estimated travel time will be 9.01 hours. MM MYou will have 62 hours, and 59 minutes to stay at the destination.
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
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
Recommended textbooks for you
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education