Write a program to accept a weekday and a time (composed of hour and minute) in...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program to accept a weekday and a time (composed of hour and minute) in 24-hour format. The user further inputs a number of minutes to be added to (or subtracted from) the time. Then it outputs the resulted day and time in 2-digit 24-hour format. 3rd digit of your student ID Odd Even Number of minutes to be ... Added Subtracted User inputs: 1. day (a string, abbreviation of weekdays: Sun, Mon, Tue, Wed, Thu, Fri, Sat) 2. hour (an integer from 0 to 23, inclusive) 3. minute (an integer from 0 to 59, inclusive) 4. number of minutes (a non-negative integer) Program outputs: 1. day and time in 2-digit 24-hour format Sample display (for odd) Mon 12 34 2468 Wed 05 42 Sample display (for even) Mon 12 34 2468 Sat 19 26 Remark: • 2468 minutes = 1 day 17 hours 8 minutes. • The number of minutes to add (or subtract) can be any non-negative integer. The result may be many weeks later (or before). • The output time is displayed in 2-digit 24-hour format. Write a program to accept a weekday and a time (composed of hour and minute) in 24-hour format. The user further inputs a number of minutes to be added to (or subtracted from) the time. Then it outputs the resulted day and time in 2-digit 24-hour format. 3rd digit of your student ID Odd Even Number of minutes to be ... Added Subtracted User inputs: 1. day (a string, abbreviation of weekdays: Sun, Mon, Tue, Wed, Thu, Fri, Sat) 2. hour (an integer from 0 to 23, inclusive) 3. minute (an integer from 0 to 59, inclusive) 4. number of minutes (a non-negative integer) Program outputs: 1. day and time in 2-digit 24-hour format Sample display (for odd) Mon 12 34 2468 Wed 05 42 Sample display (for even) Mon 12 34 2468 Sat 19 26 Remark: • 2468 minutes = 1 day 17 hours 8 minutes. • The number of minutes to add (or subtract) can be any non-negative integer. The result may be many weeks later (or before). • The output time is displayed in 2-digit 24-hour format.
Expert Answer:
Answer rating: 100% (QA)
Python def addminutesday hour minute minutestoadd weekdays Sun Mon Tue Wed Thu Fri Sat Convert the i... View the full answer
Related Book For
Systems analysis and design
ISBN: 978-0136089162
8th Edition
Authors: kenneth e. kendall, julie e. kendall
Posted Date:
Students also viewed these programming questions
-
(20 points) For each of the histories below, state whether it is (a) sequentially consistent, (b) linearizable. Justify your answer. All variables are initially zero. Concurrent History H1 P1 [...
-
The Taylor polynomial for sin(x) for a near 0 to order 5 is 1 1 sin(x) = x - + -x +0(x7) 6 120 The figure below shows a plot of sin(x) [blue] and the above Taylor polynomial [red]. 0.8 0.6 0.4 0.2 1...
-
Rewrite the PrintCalendar class in Listing 6.12 to display a calendar for a specified month using the Calendar and GregorianCalendar classes. Your program receives the month and year from the command...
-
It is clear that Jaguar practices responsibility toward the environment. Using your knowledge gained from this Jaguar case study and further research, provide five (5) examples of how Jaguar is...
-
When is your weight measured as mg?
-
A sportswriter wants to know how strongly the residents of Indianapolis, Indiana, support the local minor league baseball team, the Indianapolis Indians. He stands outside the stadium before a game...
-
Paired data are data for which each value in one sample can be matched with a corresponding value in another sample. In Exercises 5 and 6, determine whether the statement is true or false. If the...
-
For the fiscal year, sales were $5,280,000, sales discounts were $100,000, sales returns and allowances were $75,000, and the cost of merchandise sold was $3,000,000. a. What was the amount of net...
-
If the cost of equity capital is 15% p.a., the market value of equity is $5 million, the company tax rate is 30%, the cost of debt is 12% p.a. and y = 0.60, what is the cost of capital?
-
Reconsider the Skycell data in Exercise 1. Assume that the plant has 1,250 employees and a no-layoff policy. Overtime is limited to at most 20 hours per employee per month. Also assume no...
-
ABC Company is planning for the production of two products: Product X and Product Y. Based on the assumption that all items can be sold, the manager wants to make decision on how many items to...
-
Acort Industries has 10 million shares outstanding and a current share price of $36 per share. It also has long-term debt outstanding. This debt is risk free, is four years away from maturity, has...
-
A professor in the Computer Science department at United States Institute of Technology has just patented a new search engine technology and would like to sell it to you, an interested venture...
-
Develop Eq. (11.12) for Sid by appropriate application of Eqs. (5.36) and (5.37) to a mixing process. Eq. (11.12) Eq. (5.36) Eq. (5.37) sid-R x; Inx (11.12) i
-
Suppose venture capital firm GSB partners raised $50 million of committed capital. Each year over the 12-year life of the fund, 1.5% of this committed capital will be used to pay GSBs management fee....
-
John and Ralph, two brothers who are over the age of 21, are beneficiaries of a trust created in 1983 by their father, Jim. At that time, Jim transferred securities and an apartment building to a...
-
Let T(x, y, z)=(-4r + 2z, 2x-3y-22, x+2y-2) be a transformation. (a) How would you determine whether or not T is a linear transformation? (Explain in words. Be as detailed as possible.) (b) Assuming...
-
The ultimate goal of Google, Bing, and other consumer search engines is to provide users with search listings that contain useful information on the topic of their search. What recommendations would...
-
Clancys is interested in graphical output for its DSS. It wants to see a graphical comparison of how many of each style of uniform are being sold each year. a. Choose an appropriate graph style and...
-
What four kinds of information is the analyst seeking through prototyping?
-
What information is contained in the data repository?
-
(a) Consider a silicon pn junction diode operating in the forward-bias region. Determine the increase in forward-bias voltage that will cause a factor of 10 increase in current. (b) Repeat part (a)...
-
A silicon pn junction diode has an emission coefficient of \(n=1\). The diode current is \(I_{D}=1 \mathrm{~mA}\) when \(V_{D}=0.7 \mathrm{~V}\). (a) What is the reverse-bias saturation current? (b)...
-
(a) The reverse-saturation current of a gallium arsenide pn junction diode is \(I_{S}=10^{-22} \mathrm{~A}\). Determine the diode current for diode voltages of \(0.8,1.0\), \(1.2,-0.02,-0.2\), and...
Study smarter with the SolutionInn App