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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!