Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello, I was given the following assignment: The Customer class has two private

ID: 662272 • Letter: H

Question

Hello,

I was given the following assignment:

The Customer class has two private member variables:

accountID, which is a c-string or a string (your choice) for the customer's account number which you may assume consists of 6 digits.

name, which is a c-string or a string (your choice) for the customer's name which you may assume has no embedded spaces and a maximum length of 30 characters.

You may NOT create any other member variables for the Customer class.

The Customer class has two constructors, a no-argument constructor and a two-argument constructor, and possibly, a destructor.

a no-argument constructor which initializes each of the member variables to the null string (an empty string)

a two-argument constructor which sets the name and accountID to the user supplied values

You may write other constructors or a destructor as you decide is necessary. But, if you do so, please justify them in a code comment just before the added constructor or the destructor or in areadme.txt file that you will include in your zip file.

The Customer class also has two member functions:

view() displays the name of the customer and the account number

an overloaded assignment operator to copy the Customer object instantiated by the test driver to the Customer member variable of the Account instance which is also created in the test driver as shown in the following excerpts of the test driver:

Customer c (custName, acctID);

acctsPtr[aNum] = new Checking (c, startBal, overdraftOk);

//OR

Customer c (custName, acctID);

acctsPtr[aNum] = new Savings (c, startBal, intRate);

If you write additional member functions, please justify your decision in a code comment just before the added member function or in a readme.txt file or that you will include in your zip file.

Account Class

The Account base class represents a generic account which will never be instantiated as an Account object.  Subclasses (aka derived classes) of the Account base class, namely, the Savingsaccount subclass and the Checking account subclass described below, can be instantiated objects.

The Account base class has two member variables:

balance which is a floating point type and represents the amount in the account.

cust which is a Customer object.

These member variables cannot be public. You cannot add any other member variables.

The Account base class has two constructors:

a no-argument constructor which sets balance to zero and calls the corresponding no-argument Customer constructor for default initialization of the Customer member variables to null strings.

a two-argument constructor which sets balance to the value of the first parameter, a floating point value entered by the user in the test driver, and sets cust to the value of the second parameter, the Customer variable c created and initialized in the test driver, using the overloaded assignment operator of the Customer class.

You may write other constructors or a destructor as you decide is necessary. But, if you do so, please justify it in a code comment just before the added constructor or the destructor or in areadme.txt file that you will include in your zip file.

In addition to the constructors, and destructor if any, the Account base class has the following member functions:

makeDeposit

Explanation / Answer

Few issues I would like to point:

1) The value of the constant NAME_SIZE is not specified.

2) In the code snippet:

void Account::view()
{

   cust.view();
   cout << " Balance: $ " << balance<< endl;
}

The cust object is created when the Account object is created by calling Account constructor with two arguments. In case of Account constructor with no arguments, the call to Customer constructor is made but the cust object is not being created. Please check.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote