Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assume a machine during its initial testing phase produces 10 widgets a day. After 10 days of testing (starting on day 11), it begins
Assume a machine during its initial testing phase produces 10 widgets a day. After 10 days of testing (starting on day 11), it begins to run at full speed, producing 40 widgets a day. After 50 days at full speed (days 11-60), it gradually starts becoming less productive, and produces 1 fewer widget per day, (ie. 39 widgets on day 61, etc.) until on day 100 it no longer produces any widgets. Write a program that reads in a day (as an integer) from the keyboard and reports the total number of widgets produced from the initial testing phase up to and including the day entered. For example, entering 3 would report 30 widgets. Your code should also do the following: Include the valid range of day numbers on the user prompt (a positive number) Check for inappropriate day numbers and message the user accordingly Echo the input in the output when you report the number of widgets Use the output format shown below Note: Part of the challenge in this program is for YOU to work out the model for how to compute widgets produced in total, given the above information. Hint: Solve this problem by hand on paper first, then implement the solution in Python. A graph or diagram is particularly helpful. This approach is much easier than debugging some lousy Python code written before you understand the problem. Example output using input -1 (Note, You will need to change the prompt in your code): Please enter a positive value for day: -1 You entered an invalid number! Save your code as Lab4b_Act2.py and save to your hard drive. You will then upload this file to Mimir for testing.
Step by Step Solution
★★★★★
3.43 Rating (156 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started