Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE ANSWER THIS C++ code in steps show the //comments 1. According to the given UML diagram and instructions write C++ code for the following

image text in transcribed

image text in transcribed

PLEASE ANSWER THIS C++ code in steps show the //comments

1. According to the given UML diagram and instructions write C++ code for the following sections. Cashier name: string total: double noOfCashier: static int Cashier() Cashier(string, double) Cashier(const Cashier&) -Cashier) Getter and Setter methods should be defined for every private data member!!! Use this pointer while defining 'Cashier' class. The Default Constructor o accepts data from keyboard for private data members. Getter methods should return the corresponding data member. Setter methods should receive parameter from main() and change the corresponding data member. Destructor prints an appropriate message on screen when the object is destroyed. Add two functions which will be friend of Cashier class. A function moneyin will receive the amount of money received by the cashier object as a parameter from the main and then adjust the total accordingly (total will be INCREASED, because money is GOING IN). A function moneyout() will receive the amount of money paid out by the cashier object as a parameter from the main and then adjust the total accordingly (total will be DECREASED, because money is GOING OUT). Note that: Initial number of cashier is 0 (zero). citem.cpp Write a main function that will do the following steps. Create two automatic objects that one executes the parameterized constructor and the other one executes the copy constructor. Create a pointer object that executes the default constructor. Create a dynamic object that executes the parameterized constructor Create a dynamic array object that executes the default constructor which holds information for 20 cashier objects. Call related friend function to allow money in for the dynamic object and money out for the first automatic object you have created above. Call the necessary methods to print the details of dynamic array object. Display the number of cashier objects created till now. List down the name of the objects that will be destroyed automatically in a correct order. Make sure that all the objects that are not destroyed automatically are removed from the memory

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_2

Step: 3

blur-text-image_3

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

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

A chipped cracked sheet of glass is useless to us.

Answered: 1 week ago