Homeworks are done in the following periods of a day: morning, afternoon, evening. These periods refer...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Homeworks are done in the following periods of a day: morning, afternoon, evening. These periods refer to the following time intervals of a day: Morning period: [7, 11], both 7 and 11 are included. Afternoon period: [13, 17], both 13 and 17 are included. Evening period: [19, 23], both 19 and 23 are included. An hour value that does not fall in any of the above time intervals is not a time to do homework, so such an hour is considered invalid. Write a Python script that performs the following: The script gets from the user 10 inputs each referring to the hour value a homework is done. Based on the hour value entered, the script decides and prints its corresponding period (For example, if the input value is 9, the corresponding period to be printed will be "Morning"). The script prints the related period for each input value. If an input is invalid, the script should print a warning message and insist on a valid input till the user enters correctly for that iteration. At the end, the script prints the number of homeworks done in each period (For example, 2 homeworks in Morning period, 6 homeworks in Afternoon period, 2 homeworks in Evening period). Homeworks are done in the following periods of a day: morning, afternoon, evening. These periods refer to the following time intervals of a day: Morning period: [7, 11], both 7 and 11 are included. Afternoon period: [13, 17], both 13 and 17 are included. Evening period: [19, 23], both 19 and 23 are included. An hour value that does not fall in any of the above time intervals is not a time to do homework, so such an hour is considered invalid. Write a Python script that performs the following: The script gets from the user 10 inputs each referring to the hour value a homework is done. Based on the hour value entered, the script decides and prints its corresponding period (For example, if the input value is 9, the corresponding period to be printed will be "Morning"). The script prints the related period for each input value. If an input is invalid, the script should print a warning message and insist on a valid input till the user enters correctly for that iteration. At the end, the script prints the number of homeworks done in each period (For example, 2 homeworks in Morning period, 6 homeworks in Afternoon period, 2 homeworks in Evening period).
Expert Answer:
Answer rating: 100% (QA)
Since the app wont support empty spaces all the underscores represent the spaces for indent... View the full answer
Related Book For
Calculus Early Transcendentals
ISBN: 978-0321947345
2nd edition
Authors: William L. Briggs, Lyle Cochran, Bernard Gillett
Posted Date:
Students also viewed these programming questions
-
Calculate the work done in the following situations. A constant force F = (4, 3, 2) (in newtons) moves an object from (0, 0, 0) to (8, 6, 0). (Distance is measured in meters.)
-
Calculate the work done in the following situations. A constant force F = (40, 30) (in newtons) is used to move a sled horizontally 10 m.
-
Calculate the work done in the following situations. A constant force F = (2, 4, 1) (in newtons) moves an object from (0, 0, 0) to (2, 4, 6). (Distance is measured in meters.)
-
The National Health Statistics Reports dated Oct. 22, 2008, included the following information on the heights (in.) for non-Hispanic white females: a. Calculate and interpret a confidence interval at...
-
Control charts for have been maintained on a process and have exhibited statistical control. The sample size is n = 6. The control chart parameters are as follows: (a) Estimate the mean and standard...
-
Assume that your father is now 50 years old, that he plans to retire in 10 years, and that he expects to live for 25 years after he retires, that is, until he is 85. He wants a fixed retirement...
-
Identify five errors and irregularities that may occur in (a) executing and (b) recording sales transactions.
-
Wu Company's income statement for the year ended December 31, 2011, and its comparative balance sheets as of December 31, 2011 and 2010, are presented on the next page. During 2011, Wu Company...
-
What competencies and skills are critical for a successful mediator in high-stakes conflict resolution, and how can these be developed and assessed ?
-
Goldie and Kurt want advice from your financial advising firm. They have provided the following information. They graduated from university four years ago and they have good jobs, but neither of them...
-
What's the accuracy given the true labels t and the predicted labels p Note: This is a classification problem, so the value needs to be between 0 and 1 t = (1,3,2,4,3,2,1,4,3,2,3,4) p =...
-
What is a manufacturing network?
-
The value of a payment depends on when it is made. a. Future value is the present value of an initial investment times one plus the interest rate for each year you hold it. The higher the interest...
-
Explain the role of the customer in a total quality setting.
-
Give a brief rationale for empowerment.
-
Jane and Mike purchase identical houses for $400,000. Jane makes a down payment of $80,000, while Mike puts down only $20,000; for each individual, the down payment is the total of his or her net...
-
A bond that settles on June 7, 2019, matures on July 1, 2039, and may be called at any time after July 1, 2029, at a price of 136. The coupon rate on the bond is 6.4 percent and the price is 151.00....
-
After graduating from college and working a few years at a small technology firm. Preet scored a high-level job in the logistics department at Amex Corporation. Amex sells high-quality electronic...
-
Complete the following steps for the given function, interval, and value of n. a. Sketch the graph of the function on the given interval. b. Calculate x and the grid points x 0 , x 1 , x n . c....
-
State the three Pythagorean identities.
-
Determine whether the following series converge or diverge. In the case of convergence, state whether the convergence is conditional or absolute. (-1)* 00 k In k k=2
-
Explain the role of parameters and return values in exchanging messages.
-
Describe events. Provide an example.
-
What are the building blocks of a sequence diagram?
Study smarter with the SolutionInn App