Question
Problem Statement: A new fruit juice machine has been purchased for the cafeteria, and a program is needed to make the machine function properly. The
Problem Statement:
A new fruit juice machine has been purchased for the cafeteria, and a program is needed to make the machine function properly. The machine dispenses apple juice, orange juice, mango lassi, and fruit punch in recyclable containers. In this programming example, we write a program for the fruit juice machine so that it can be put into operation.
The program should do the following:
- Show the customer the different products sold by the juice machine.
- Let the customer make the selection.
- Show the customer the cost of the item selected.
- Accept money from the customer.
- Release the item.
Hint: A juice machine has two main components: a built-in cash register and several dispensers to hold and release the products.
What to Do
. Work through the example.
. Type the code into your project.
. Get the pieces to work together.
. Write a main function that exercises these two classes.
. Evaluate how these two classes interact with each other.
. Compile the pieces into a cohesive program that is properly split into
declaration/specification, implementation/definition, and main.cpp files. Your completed project should have these five files:
1. cashRegister.h
2. cashRegister.cpp
3. dispenserType.h
4. dispenserType.cpp
5. main.cpp
What to Do Next
Now change your program a bit before you submit it.
1] Add some drinks.
2] Have your dispenser track how much money has been deposited, and only issue a drink when the required cents has been deposited.
3] Also make sure to tell the user if they have a change coming back from the machine. Optional: Allow the customer to order multiple drinks at a time.
What to Submit
A zip file of your exported project archive.
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