Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 5 . 1 Project 1 : Theater As the manager of a movie theater, you are looking for ways to speed up taking inventory
Project : Theater
As the manager of a movie theater, you are looking for ways to speed up taking inventory at the end of each week. Write a program to track the following items:
Cups cents each
Candy bars cents each
Bags of popcorn cents each
Bottled water 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 when you want the following quantities of each at the start of the week:
Cups:
Candy bars:
Bags of popcorn:
Bottled water:
The input will be formatted as a spaceseparated list of numbers representing the number of cups, candy bars, bags of popcorn, and bottles of water remaining. For example:
Would mean you have cups, candy bars, bags of popcorn, and 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 the theater is open days a week
Example
Enter the number of cups, candy, popcorn, and water remaining:
Need: cups, candy bars, bags of popcorn, and bottles of water
Cost: dollars and cents
Average sold: cups, candy bars, bags of popcorn, and bottles of water per day
Notes
Be sure to match the output in the example exactly. You do not need to worry about handling plural vs singular forms of the words in the output. For example, outputting cups is acceptable and expected.
Do not use the type float; use double instead.
To print doubles with two decimals, use printflf var;
Assume valid input.
Remember: doubles do not store values precisely. Because of this precision loss, you may need to round when determining cents, or store and perform all calculations using ints.
Testing
A part of programming is testing your code. While there may be example cases you should also develop test cases of your own before submitting. Think of the following cases to check:
Did not sell anything all items fully stocked
Sold everything all items at
Sold only of an item
Sold only of each item
Etc.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started