Assume a machine during its initial testing phase produces 10 widgets a day. After 10 days...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Related Book For
Financial Algebra advanced algebra with financial applications
ISBN: 978-0538449670
1st edition
Authors: Robert K. Gerver
Posted Date:
Students also viewed these algorithms questions
-
Write a program that will take as input two Web page URLs and find a path of links from one to the other. What is an appropriate search strategy is bidirectional search a good idea? Could a search...
-
Write a program that will compute statistics for eight coin tosses. The user will enter either an h for heads or a t for tails for the eight tosses. The program will then display the total number and...
-
Write a program that will read data from the file "p6.txt". The file (that you will create) always contains 15 test scores (whole numbers between 0 and 100). The test scores are scores for 5 students...
-
Assume that investment spending depends only on the interest rate and no longer depends on output. Given this information, a decrease in money supply: a. will cause investment to increase. b. may...
-
Boring Unreliable Gadget Inc.s stock price S is $50 today. The company, however, reliably pays quarterly dividends to shareholders. For example, BUG paid $0.95 dividend one month back; it will pay $1...
-
In how many ways can the 11 identical horses on a carousel be painted so that three are brown, three are white, and five are black?
-
Discuss the reasons why almost all colonies had achieved independence by the end of the 1960s.
-
Suppose the Baseball Hall of Fame in Cooperstown, New York, has approached Hobby-Cardz with a special order. The Hall of Fame wishes to purchase 57,000 baseball card packs for a special promotional...
-
To protect the nation against terrorism, the President proposed the enactment of legislation that would authorize the Secretary of Homeland Security ("the Secretary") to issue "National Security...
-
In 2019, Andes Corporation purchases $1.5 mil-lion of machinery (7-year property) and places it into service in its business. What are Andes' depreciation deductions for 2019 and 2020 in each of the...
-
Suppose a closed economy had public saving of -$1 trillion and private saving of $3 trillion. What are national saving and investment for this country?
-
2. Given a square matrix A, eigenvalues of A are denoted as A, and are found by solving det(A-AI) = 0. (a) Define matrix A to be 1 -1 0 A = -1 2 -1 0 -1 1 Find a cubic equation for the eigenvalues of...
-
A Grammar for Simple Assignment Statements = AB | C + | * | ) | Using the grammar above, show a complete leftmost derivation for each of the following statements: Please number each steps beginning...
-
Consider the following high-level code snippet. Assume that the base addresses of arrayl and array2 are held in R1 and R2 and that array2 is initialized before it is used. int i; int array1[100]; int...
-
5. (20pts) Consider the following data and answer the questions using R. Make sure your answer includes both R command and the final answer/diagram. 55 61 94 94 69 77 68 54 85 77 92 92 81 73 69 81 75...
-
5.2 Rewrite the following CISC-style program fragment so that it executes correctly on a RISC (load-store) processor that executes the GPR ISA outlined in the previous chapter. Assume that the GPR...
-
Exhibit 1 Memo From: Julia Bernhardt To: Joseph Morris, Esq., Morris and Associates Legal Firm Subject: Stock Issuance Date: January 11, year 1 According to the Articles of Incorporation for RRL,...
-
During 2012, Cheng Book Store paid $483,000 for land and built a store in Georgetown. Prior to construction, the city of Georgetown charged Cheng $1,300 for a building permit, which Cheng paid. Cheng...
-
Jean bought a $1,980 snow thrower on the installment plan. The installment agreement included a 10% down payment and 18 monthly payments of $116 each. a. How much is the down payment? b. What is the...
-
The Lerners had x dollars in medical expenses. Medical insurance covered 80% of these expenses, so they had to pay 20% of the medical bills. The IRS allows medical and dental expenses deductions for...
-
The Gidget Widget Corporation produces widgets. The fixed expenses are $65,210, and the variable expenses are $4.22 per widget. Express the expense function algebraically.
-
Stevenson Company's trial balance as of December 31, 2022 shows \($35,000\) for inventory; but the balance sheet shows \($33,000.\) Assuming no inventory shrinkage, what is the most likely reason for...
-
Amanda Company started business at the beginning of 2022. The company applies the lower-of-cost- or-net-realizable-value rule to its inventory as a whole. Inventory cost and market value as of the...
-
Which one of the following costs is not included in inventory for manufacturing firms? a. Raw materials used in production b. Raw materials unused and stored in the warehouse c. Salary paid to the...
Study smarter with the SolutionInn App