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
Get step-by-step solutions from verified subject matter experts
