Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using PYTHON please Imagine that you are managing a widgets producing plant, and measure production each day. Production is in number of widgets produced Write
Using PYTHON please
Imagine that you are managing a widgets producing plant, and measure production each day. Production is in number of widgets produced Write a program that will let you enter in the daily production for an arbitrary number of days, n; one day's production at a time. The program will prompt the user to enter daily production for Day 1, and after the user enters the requested information, the program will ask for daily production for Day 2, and so on. Make sure your program can collect the number of widgets for an arbitrary number of days. You can stop taking input when a user enters a negative number. Be sure to give a descriptive message telling what to input. After the user input is complete, the program uses intervals of lengths starting from 1 day, increasing by 1 day, all the way to the interval of length equal to the total number of days, n, for which the production has been entered. For each interval length, the program compares the daily production of the last day of every interval with the daily production of the first day. If the last day's production is greater than that of the first day, the production is considered to be increasing in that interval The program determines for periods of time ranging from 1 day intervals to the maximum interval, whether the production is rising or falling For the output, you want to report, for each possible interval from 1 day to the maximum interval, what percentage of intervals had increasing production, and what percentage of intervals had decreasing production (some could be the same). Print the output with 1 digit after the decimal. For example, if the widget production was entered for 5 conseive days, and the production levels were 13, 15, 17, 15, 18, you might output something like For 1-day intervals, 75.0% of the intervals had increasing and 25.0% decreasing production For 2-day intervals 66.7% of the intervals had increasing and 0.0% decreasing production For 3-day intervals 100.0% of the intervals had increasing and 0.0% decreasing production For 4-day intervals 100.0% of the intervals had increasing and 0.0% decreasing production The first line is because out of the four one-day intervals, 13-15, 15-17, and 15-18 were increasing, while 17-15 was decreasing. The second line is because out of the three two-day intervals, 13-17 and 17-18 were increasing, while 15-15 was neither increasing nor decreasing. The third line is because both four-day intervals, 13-15 and 15-18 were increasing, and the final line is because the one four-day interval 13-18 was increasing There is more than one way to get one decimal place after the number. One option is for your team to look up and learn the command for formatting floating-point outputStep by Step Solution
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