Imagine that you are managing a plant, and measure production each day. Production is in number of widgets, and you want a program that will let you enter in the number of widgets, and then tell whether for periods of time ranging from 1 day intervals to the maximum interval, 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 thenumber 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 tothe 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 decima 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 decreasingFor 2-day intervals 66.7% were increasing and 0.0% were decreasingFor 3-day intervals 100.0% were increasing and 0.0% were decreasingFor 4-day intervals 100.0% were increasing and 0.0% were decreasingThe first line is because outof the four one-day intervals, 13-15, 15-17, and 15-18 were increasing, while 17-15 was decreasing. The second line is becauseoutof the three two-day intervals, 13-17 and 17-18 were increasing, while 15-15 was neither increasing nor decreasing

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Imagine that you are managing a plant, and measure production each day. Production is in number of widgets, and you want a program that will let you enter in the number of widgets, and then tell whether for periods of time ranging from 1 day intervals to the maximum interval, 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 thenumber 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 tothe 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 decima

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 decreasingFor 2-day intervals 66.7% were increasing and 0.0% were decreasingFor 3-day intervals 100.0% were increasing and 0.0% were decreasingFor 4-day intervals 100.0% were increasing and 0.0% were decreasingThe first line is because outof the four one-day intervals, 13-15, 15-17, and 15-18 were increasing, while 17-15 was decreasing. The second line is becauseoutof 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 thefinal line is because the one four-day interval 13-18 was increasing.

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education