subject
Computers and Technology, 17.10.2020 20:01 etuck16

Imagine that you are managing a plant, and measure production each day. You want a program that will let you enter in the number of widgets, and then tell whether the production is rising or falling. You want this to work for an arbitrary number of days. That is, you should be able to enter as many days as you want, and get a report as to days increasing or decreasing For the input, 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. For the output, you want to report, for each possible interval from 1 day to the maximum interval, what percentage of differences in widget production were increasing, and what percentage of intervals were decreasing (some could be the same). Print the output with 1 digit after the decimal. For example, if the widget production was entered for 5 consecutive days, and the production levels were 13, 15, 17, 15, 18, you might output something like
For 1-day intervals 75.0% were increasing and 25.0% were decreasing
For 2-day intervals 66.7% were increasing and 0.0% were decreasing
For 3-day intervals 100.0% were increasing and 0.0% were decreasing
For 4-day intervals 100.0% were increasing and 0.0% were decreasing The first line is because the 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 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 Before your team starts coding, consider exactly how you will make these computations. The looping in this problem is trickier than what you have encountered previously, and formatting the output may be a challenge for you (work together as a team to figure out how you might print the percentages with exactly 1 place after the decimal. Remember to use the methods we have discussed for testing, and using incremental development.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 13:30
Select the correct answer from each drop-down menu. which types of computer networks are bigger as well as smaller than a man? a man is a network of computers that covers an area bigger than a , but smaller than a .
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Which task uses a simple parameter?
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
What would be the address of the cell, which is at the intersection of the second row and the third column in a worksheet?
Answers: 1
question
Computers and Technology, 24.06.2019 00:20
The guy wire bd exerts on the telephone pole ac a force p directed along bd. knowing the p must have a 720-n component perpendicular to the pole ac, determine the magnitude of force p and its component along line ac.
Answers: 2
You know the right answer?
Imagine that you are managing a plant, and measure production each day. You want a program that will...
Questions
question
Computers and Technology, 04.02.2021 06:50
question
Mathematics, 04.02.2021 06:50
question
Spanish, 04.02.2021 06:50
question
Mathematics, 04.02.2021 06:50
question
English, 04.02.2021 06:50
Questions on the website: 13722367