Add a new Java class to your project by right clicking on the src folder in the Project pane and select New > Java Class. Enter Hours as the name for this class, and IntelliJ will add it to the files in the src folder for your project. Remember to copy and insert the standard heading for the main method as you did for Program 2. Write a program that prompts the user to enter a number of hours, and produces the equivalent number of days as a whole number along with the number of hours left over. Assume that a day has exactly 24 hours. The following example shows the format to use for your output, where the input entered by the user is underlined.

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

Add a new Java class to your project by right clicking on the src folder in the Project pane and select New > Java Class.
Enter Hours as the name for this class, and IntelliJ will add it to the files in the src folder for your project. Remember to
copy and insert the standard heading for the main method as you did for Program 2.
Write a program that prompts the user to enter a number of hours, and produces the equivalent number of days as a whole
number along with the number of hours left over. Assume that a day has exactly 24 hours. The following example shows
the format to use for your output, where the input entered by the user is underlined.
Enter the number of hours: 100
100 hours is 4 days, plus 4 hours.
Define Variables: The number of hours will be a whole number, and we would like to obtain results as whole numbers of
days and hours, so use the int data type to declare the variables to hold the numbers of hours input, as well as the results
(the number of days and number of hours left over). The days and hours left over will need to be calculated by assignment
statements with expressions on the right side to perform the appropriate division and remainder operations. Remember
that a remainder can be calculated by using the modulus operator (%), as demonstrated in the Variables.java example
program.
Testing and Report: Run the program and check that it is producing the correct results.
Test your program for 12 hours, 100 hours, 240 hours, 250 hours, and 10000 hours. When your program is
working correctly, select the text in the console window to copy and paste it into your report file (output.txt),
adding a new section below your results for Program 2. Copy the exact output from the console after running your
program four times with the five different input values. 

Expert Solution
Step 1 Introduction

Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. Java is an object oriented programming languages and it is used to create the web applications, different types of the applications using the different features of the java.

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Math class and its different methods
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