Description
In the world of movie In Time, time has become the ultimate currency. The money you have is the time displayed on your arm, and you pay everything in days, hours, and minutes. (We don't have to use seconds in this assignment.)
Now assume that you are running a coffee shop in that world. The price for coffee is: 3 minutes for a COFFEE, 5 minutes for a COFFEE PLUS and 7 minutes for a COFFEE X. If you know how many cups of coffee you can sell every day, how much time can you earn every day?
Write a program that asks how much cups of coffee you can sell everyday and then outputs the total number of days, hours, and minutes you can earn. Note: there are 1440 minutes in a day.
Compute the total number of minutes you can earn and then convert that to days, hours and minutes, in that order.
For example, if you can earn 1503 minutes everyday, the output should read:
1 days, 1 hours, and 0 minutes
It should not be output as:
0 days, 25 hours, and 3 minutes
Here's an example run (the user input is in italics):
Hello! How many COFFEE can you sell every day?
1000
How many COFFEE PLUS can you sell every day?
500
How many COFFEE X can you sell every day?
100
You can earn 6200 minutes.
That is 4 days, 7 hours, and 20 minutes.
Hint
Pay special attention to the paragraph about division on p. 69-70 (p. 63 for 5th Ed) of the textbook.
Extra Credit
Change your output to be grammatically correct for all outputs. That is, 1 hour should be singular and 2 hours should be plural. The same is true for days and minutes.
If you can earn 1503 minutes, the output should read:
What to Do
What to Turn in
Submit via Sakai the following:
yourlastname_program1.jar
file (where yourlastname
is your last name),
which includes your Time.java
source fileRequirements
When I examine your program, it must satisfy the following requirements. The maximum point value for each is shown in brackets.