Create a class named CBank. Separate the class interface from the implementation of the CBank class. Put the class definition in a file named CBank.h and the class implementation in a file named CBank.cpp.
Create four private data members to hold the number of pennies, nickels, dimes, and quarters in the bank.
Create public accessor and mutator member functions to get and set each of the four data members. Your functions must be named setPennies, getPennies, setNickels, getNickels, setDimes, getDimes, setQuarters, and getQuarters. Do not print from these functions or obtain input from the user from these functions (for example - no cin or cout statements).
Create exactly one constructor. This constructor should receive four arguments that correspond to the number of pennies, nickels, dimes, and quarters that are initially in the bank. Make each argument a default argument that will initialize each data member to zero (0) should a value not be provided. The constructor must print a message indicating it has been executed.
The class should have a destructor that prints a message indicating it has been executed.
Provide a member function named getBank that takes in no arguments. This function computes and returns back the total sum of money (in dollars and cents) in the bank. Do not print from this function.
Do not create any inline functions for this class.
Write a client application that uses the CBank class. Name this file UseCBank.cpp. This application must meet the following requirements.
Explicitly create three CBank objects. Use the default arguments for the first object. Pass four values representing the pennies, nickels, dimes, and quarters to the constructor for the second object. Pass only two values (the first two) to the constructor for the third object.
Print the values for each object. That is, print the number of pennies, nickels, dimes, and quarters in the bank for the first object. Then print the total value of the money formatted for currency (2 places after the decimal point) in the bank using the results of the getBank function. Repeat this for the second object and then the third object. The logic to print the object must be in a function separate from main. Pass the appropriate object as a reference argument. Use the const modifier as appropriate.
Use the set methods to change the number of pennies, nickels, dimes, and quarters in one of the CBank objects. Print the same information for this object as was printed above.