Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions