As the manager of a movie theater, you are looking for ways to speed up taking inventory at the end of each week. You will write a program to track the following items:

computer science

Description

As the manager of a movie theater, you are looking for ways to speed up taking inventory at the end of each week. You will write a program to track the following items:

  • Cups (5 cents each)
  • Candy bars (30 cents each)
  • Bags of popcorn (20 cents each)
  • Bottled water (50 cents each)

At the end of each week, you want to enter how many of each item you have, and your program will calculate how many of each item you need to order given you want 1000 of each at the start of the week.

The input will be formatted as a space-separated list of numbers representing the number of cups, candy bars, bags of popcorn, and bottles of water remaining. For example:

Input

368 453 231 576

Would mean you have 368 cups, 453 candy bars, 231 bags of popcorn, and 576 bottles of water. Your program should then calculate:

  • How many of each item you need to restock
  • The total cost to restock
  • The average number of each item sold per day

So, given our previous input, the following output would be expected:

Output

You need to buy 632 cups, 547 candy bars, 769 bags of popcorn, and 424 bottles of water
This will cost 561 dollars and 50 cents
On average you sold 90.285714 cups, 78.142857 candy bars, 109.857143 bags of popcorn, and 60.571429 bottles of water per day

Notes

You do not need to worry about handling plural vs. singular forms of the words in the output. For example, outputting 1 cups is acceptable and expected.

Grading

There are 10 test cases, each worth 10 points, for a total of 100 points. Each test case has three parts, testing for the output pertaining to:

  • How many of each item you need to restock (3 points)
  • The total cost to restock (3 points)
  • The average number of each item sold per day (4 points)


Related Questions in computer science category