Answered step by step
Verified Expert Solution
Link Copied!

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

 Example output using input-1 (Note, You will need to change the prompt in your code):: Please enter a positive value for day: 

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Algebra advanced algebra with financial applications

Authors: Robert K. Gerver

1st edition

978-1285444857, 128544485X, 978-0357229101, 035722910X, 978-0538449670

More Books

Students also viewed these Algorithms questions