Question
This code is what I've got so far, but I need help implementing an account system so that I can load and save all data
This code is what I've got so far, but I need help implementing an account system so that I can load and save all data to and from a binary file. The data should be loaded into an STL vector. I need to include a menu system to add customers and accounts, delete customers and accounts and print accounts sorted by balance as well as print customers sorted by last name. Don't worry about any of the 4 accounts(savings, checking, CD, or money market), I just need to get the class Accounts working and the Customer class working. My code below compiles, but I'm not sure where to go from here. I've got he hirearchy as it is supposed to be. (c++)
Thanks
#include
using namespace std;
class BaseAcc //Base
{
public:
//anything dealing with money have virtual
virtual void deposit()=0;
virtual void withdraw()=0;
virtual void interest()=0;
virtual void penalty()=0;
};
class Account : public BaseAcc
{
char name[50];
int AccID;
char AccType[20];
double balance;
int CustID;
virtual void withdraw()
{
cout << "withdraw BaseAcc";
}
virtual void deposit()
{
cout << "Deposit BasaeAcc";
}
//make menu
void Account::display()
{
cout << "Accout Management: " << endl;
cout << "Name: " << name << endl;
cout << "Account ID: " << AccID << endl;
cout << "Account Type: " << AccType << endl;
cout << "Balance: " << balance << endl;
}
};
class savings : public Account
{
void withdraw()
{
cout << "Withdraw as savings account." << endl;
}
void deposit()
{
cout << "Deposit as a savings account." << endl;
}
void interest()
{// 1.05% monthly interest
}
void penalty()
{//balance <$1000.00 = $50.00
}
};
class checking :public Account
{
public:
void getBalance()
{
cout << "Get balance of checking" << endl;
}
void withdraw()
{
cout << "Withdraw as a checking account" << endl;
}
void deposit()
{
cout << "Deposit as a checking account" << endl;
}
void interest()
{ //2% monthly interest
}
void penalty()
{ //no penalties
}
};
class CD :public Account
{
void getBalance()
{
cout << "Get balance as a CD account" << endl;
}
void withdraw()
{
cout << "withdraw as a CD account" << endl;
}
void deposit()
{
cout << "Deposit as a CD account" << endl;
}
void interest()
{ //3 months 2.5%
//6 months 3%
// 12 months 5%
}
void penalty()
{ // < 3 months deducts 10%
// < 6 months deducts 20%
// < 12 months deducts 50%
}
};
class MoneyMarket :public Account
{
void getBalance()
{
cout << "Get balance of MM" << endl;
}
void withdraw()
{
cout << "withdraw as a MM account" << endl;
}
void deposit()
{
cout << "Deposit as a MM account" << endl;
}
void interest()
{ //1.25 monthly interest
}
void penalty()
{ //if balance < $10,000 = $200
}
};
class Person
{
public:
char name;
int PhNO;
};
class Customer :public Person
{
public:
int CustID;
};
void main(void)
{
system("pause");
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started