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 19:20
Terri needs to insert a cover page into her document. where should she go to access the commands to do so? o insert tab, objects group o insert tab, illustrations group o insert tab, pages group o insert tab, media group submit
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
Auser is given read permission to a file stored on an ntfs-formatted volume. the file is then copied to a folder on the same ntfs-formatted volume where the user has been given full control permission for that folder. when the user logs on to the computer holding the file and accesses its new location via a drive letter, what is the user's effective permission to the file? a. read b. full control c. no access d. modify e. none of the above
Answers: 1
question
Computers and Technology, 23.06.2019 22:20
What is a programming method that provides for interactive modules to a website?
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Which explains extrinsic motivation? a)motivation in which there is a reward b)motivation that is personally satisfying c)motivation that is personally meaningful d)motivation in which the subject is interesting
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
Mathematics, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
History, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
Geography, 18.09.2020 21:01
question
Biology, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
English, 18.09.2020 21:01
question
Mathematics, 18.09.2020 21:01
question
Social Studies, 18.09.2020 21:01