Question: I'm making a banking system so a single person can make four accounts (checking, saving, money market, and CD). I just need to make the
I'm making a banking system so a single person can make four accounts (checking, saving, money market, and CD). I just need to make the classes Account and Customer working. I need help making a menu and making sure I can enter a name in the for the Customer class. And also make sure I can enter an Acctype(either checking, saving, money market, and CD), balance(in the account that is chosen), and CustID(customer ID) in the Account class. I also need help making the CustID relate in the Account class and Customer class.
Thank you for the help. The code below compiles and runs. Please make sure I can still compile it when you're done. (C++)
#include
using namespace std;
class GenericAcc //Base
{
public:
virtual void deposit()=0;
virtual void withdraw()=0;
virtual void interest()=0;
virtual void penalty()=0;
};
class Account : public GenericAcc
{
char name[50];
int AccID;
char AccType[20];
double balance;
int CustID;
virtual void withdraw()
{
cout << "withdraw genericAcc";
}
virtual void deposit()
{
cout << "Deposit GenAcc";
}
//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;
}
///switch in main?
};
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
Get step-by-step solutions from verified subject matter experts
