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, 22.06.2019 23:30
Jaina and tomas are being considered as new tenants in an apartment. the landlord looks at their creditworthiness because he wants to be sure his new tenant pays the rent on time and in full. the table below summarizes the information that was on their applications. application information questions jaina tomas how many years have you had your job? 5 2 what is your monthly salary? $1,850 $2,500 how many credit cards do you have? 4 1 how much debt do you have? $13,000 $7,000 how many times were you late with payments on credit cards in the past year? 5 1 who will the landlord decide to be more creditworthy and why? tomas because the ratio of his debt to income is less. jaina because she has had her job longer, which makes her look more stable. jaina because she has more credit cards available to her. tomas because he makes more money per month.
Answers: 2
question
Computers and Technology, 23.06.2019 13:50
Explain how email technologies enable the exchange of messages between users. find out the typical parts of an email address and explain each part.
Answers: 1
question
Computers and Technology, 24.06.2019 11:20
Colby works as a shipping clerk for a major package delivery service. some of his daily tasks include tracking shipments and entering orders. which aspect of the information technology cluster would he most likely be trained in? a.networkingb.databasesc.hardwared.software
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
Ais a built in formula in spread spread a is any math process such as addition or subtraction. options are function and operation
Answers: 1
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
History, 31.10.2019 04:31
question
Social Studies, 31.10.2019 04:31
question
Biology, 31.10.2019 04:31
Questions on the website: 13722367