Question
Design and implement a juice machine. Your machine sells orange, apple, mango and banana juices. The machine has two main components: a cash register and
Design and implement a juice machine. Your machine sells orange, apple, mango and banana juices. The machine has two main components: a cash register and several dispensers.
The program should
Show the customer the different products sold by the machine
Get the customers selection
Sell the product
Create two classes the cashRegisterType and the dispenserType.
The cashRegisterType consists of one private int variable to represent cashOnHand and three public methods an int getCurrentBalance(), a void acceptAmount(int amountIn), and a cashRegisterType(int cashIn=500) constructor.
The dispenserType consists of two private int variables to represent the numberOfItems and the cost. It also has three public methods an int getCost (), a void makeSale(), and a dispenserType(int setNoOfItems=50, int setCost=50) constructor.
Illustrate how to use these two classes in your program.
Refer to the C++ Programming Learning module on classes.
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