Description 1 This project will use an account class that ha

Description 1) This project will use an account class that has the members: std stri ng account code: std: string first name. std-string last name: double balance, Provide a constructor that initializes ALL members in its initialization list with data passed in as arguments to the constructor. You will also need accessor functions to get the account code and balance and to set the balance. In addition, include two pure virtual functions that look like the following: virtual void monthly update0 0: virtual char type0 const 0; 2) Design and implement the following derived classes that will inherit from account and implement the monthly update function in the following manner: Implementation Class Name simple account balance 1.05 balance balance (balance 5000 106 104) bonus account service account balance (balance 5.0) 1.04 balanced account balance balance 500.0 balance 105 (balance 50) 1.03 The type function returns a single character that describes the type as indicated in the part 3. Use thi virtual function to indicate the account type instead of storing the character. ctory function or class that reads data in the following fixed format: account code 10 characters first name: 15 characters last name: 25 characters type: 1 character balance numeric 8 digits, decimal place, 2 digits and uses that data to allocate and construct one the derived objects based on the value of type as indicated in the following table:

Solution

1) class Account{
Account(std::string account_code, std::string first_name, std::string last_name, double balance)
{
this.account_code = account_code;
this.first_name = first_name;
this.last_name = last_name;
this. balance = balance;
}

void setAccountCode(std::string account_code)
{
this.account_code = account_code;
}

std::string getAccountCode()
{
return account_code;
}

void setBalance(double balance)
{
this.balance = balance;
}

double getBalance()
{
return balance;
}

}

 Description 1) This project will use an account class that has the members: std stri ng account code: std: string first name. std-string last name: double bala

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site