Also, you can leave the URL of your Javadoc as a comment in the code. - 0.5
Fantastic news! We've Found the answer you've been seeking!
Question:
- 0.5 pt Provide documentation comments for both parts.
- 0.5 pt Generate Javadoc API documentation and post it on a website (not just locally!
Must be accessible to other people, can use GitHub ).
- 1 pt Test writePrimes or printTimeDifference using Junit test.
Transcribed Image Text:
Write a program that reads two times in military format (hhmm) from the user and prints the number of hours and minutes between the two times. If the first time is later than the second time, assume the second time is the next day. Remember to take care of invalid user inputs, that is, your program should not crash because of invalid user input. Hint: take advantage of the printTime Difference method you wrote in Assignment 1. You can either update that method so it will do the input validation or do the validation before calling the method. Examples These are just examples. You can have a different design as long as it's reasonable. For example, you can ask the user to enter 2 times in one line, separated by a comma; or you can have different print out messages for invalid input; or you can ask the user to re-enter instead of terminating the program; etc. User input is italic and in color. Example 1 Please enter the first time: 0900 Please enter the second time: 1730 8 hour(s) 30 minute(s) Example 2 (invalid input) Please enter the first time: haha Invalid input! Program terminated! Grading +1 pt your program takes user input and works for valid user inputs +1 pt your program won't crash due to invalid user inputs +1 pt your program treats different kinds of invalid inputs accordingly + up to 1 pt (extra credit): your program is well-designed and exceeds my expectations. (For the above, think of something like an interface, or any interesting modification that shows effectiveness or entertains). Write a program that reads two times in military format (hhmm) from the user and prints the number of hours and minutes between the two times. If the first time is later than the second time, assume the second time is the next day. Remember to take care of invalid user inputs, that is, your program should not crash because of invalid user input. Hint: take advantage of the printTime Difference method you wrote in Assignment 1. You can either update that method so it will do the input validation or do the validation before calling the method. Examples These are just examples. You can have a different design as long as it's reasonable. For example, you can ask the user to enter 2 times in one line, separated by a comma; or you can have different print out messages for invalid input; or you can ask the user to re-enter instead of terminating the program; etc. User input is italic and in color. Example 1 Please enter the first time: 0900 Please enter the second time: 1730 8 hour(s) 30 minute(s) Example 2 (invalid input) Please enter the first time: haha Invalid input! Program terminated! Grading +1 pt your program takes user input and works for valid user inputs +1 pt your program won't crash due to invalid user inputs +1 pt your program treats different kinds of invalid inputs accordingly + up to 1 pt (extra credit): your program is well-designed and exceeds my expectations. (For the above, think of something like an interface, or any interesting modification that shows effectiveness or entertains).
Expert Answer:
Answer rating: 100% (QA)
Sure here is a Python program that reads two times in military format hhmm from the user and prints the number of hours and minutes between the two ti... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these accounting questions
-
MY NOTES ASK YOUR TEACHER PRACTICE ANOTHER An unknown substance has a mass of 0.125 kg and an initial temperature of 90.0C. The substance is then dropped into a calorimeter made of aluminum...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Write a function my_ieee_2_dec(ieee), where icce is a string contains 64 char- acters of ones and zeros representing a 64-bit IEEE754 number. The output should be d, the equivalent decimal...
-
Tire Corral has $6000 available per month for advertising. Newspaper ads cost $100 each and can occur a maximum of 21 times per month. Radio ads cost $300 each and can occur a maximum of 28 times per...
-
Jonas Bravario hires Suzanne Hermano, a securities broker, to manage his $700,000 portfolio of securities. When Bravario managed his own investments, his investment strategy was to own a large number...
-
Gibbs' phase rule finds application when heat transfer occurs by (a) Conduction (b) Convection (c) Radiation (d) Condensation.
-
NorthStar Airlines runs daily commuter flights from Washington, D.C., to Chicago. The planes hold 60 passengers and cater to the business traveler with comparable business rates. The recent economic...
-
12. Solve 2x-1 < x+7 X+1 using graphing technology and explain the procedure. Show work algebraically that supports your answer.
-
Your client, Schroeder Manufacturing Co., provided the following schedule of property, plant, and equipment for the year ended June 30, 2019. Balances have been agreed to the general ledger. As part...
-
Hanson, James, and Smith, a partnership, is in the process of liquidating. The partners have the following capital account balances; $48,000, $48,000, and ($18,000) respectively. The partners share...
-
Two ways in which Enron used SPEs to overstate earnings were the abuse of mark-to-market accounting and contrived related party sales. Choose one asset that Enron used to employ both of these methods...
-
Ruby Company manages the daily operations for the human resources department of Jade Company. In terms of the contract, Ruby receives a fee of \($100\) per year for each employee on Jades payroll,...
-
Rhodes Co. manages a school for the Old England School District. In year 1, Rhodes Co.s first year of operating the school, the school earned per pupil fees of \($100,000.\) Rhodes is responsible for...
-
Greasy Patties Corporation, a hamburger chain, has 100 stores. In its tenth year of operating, its total sales for year 10 amounted to \($100\) million. During year 11, Greasy Patties Corporation...
-
In the ____________case, the issue was that it did not accurately and completely describe the realities of its operations in its MD & A.
-
A vessel of volume 2000 cm 3 contains 0.1 mole of oxygen and 0.2 mole of carbon dioxide. If the temperature of the mixture is 300 K, find its pressure a) 275 kPa b) 375 kPa c) 250 kPa d) 125 kPa
-
Hardin Services Co. experienced the following events in 2016: 1. Provided services on account. 2. Collected cash for accounts receivable. 3. Attempted to collect an account and, when unsuccessful,...
-
Fisafolia Corporation has gross income from operations of $220,000 and operating expenses of $160,000 for 2012. The corporation also has $20,000 in dividends from publicly traded domestic...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-6. On December 12, Irene purchased the building where her store is located. She paid...
-
Karim Depak received a Form 1099-B showing the following stock transactions and basis during 2012: None of the stock is qualified small business stock. Calculate Karim's net capital gain or loss...
-
Clausius-Clayperon equation is applicable to (a) Solid-vapour (b) Solid-liquid (c) Liquid-vapour (d) All of these.
-
The reaction \(A(\mathrm{l}) ightarrow R(\mathrm{~g})\) is allowed to reach equilibrium condition in an autoclave. At equilibrium there are two phases - one a pure liquid phase of \(A\) and the other...
-
The equilibrium constant for the reaction \(\mathrm{N}_{2}(\mathrm{~g})+3 \mathrm{H}_{2}(\mathrm{~g}) ightarrow 2 \mathrm{NH}_{3}\) is 0.1084 . Under the same conditions, the equilibrium constant for...
Study smarter with the SolutionInn App