Accounts, C/C++ Programming

Write a program to process bank accounts. Create a base class named Account and two derived classes named Savings and Checking. In the base class, use an int AccountNum and a double balance for data members. Also, create an overloaded operator+= function to do deposit and an overloaded operator-= function to do withdraw. The printBalance function is created to print both savings and checking accounts. The account number of new account is automatically generated by the program beginning at account number one.

here is what I have started


using namespace std;

int main()
vector < Checking * > checking(50);
vector < Savings * > savings(50);
int accNumS = 0, accNumC=0;
double bal = 0, amt = 0
int choice

cout<<"Enter one of the following:";
cout<<"1) Create a new Checking Account";
cout<<"2) Create a new Savings Account";
cout<<"3) Make a Deposit for Checking Accoutn(s)";
cout<<"4) Make a Withdrawl for Checking Account(s)";
cout<<"5) Make a Deposit for Savings Account(s)";
cout<<"6) Make a Withdrawl for Savings Account(s)";
cout<<"7) Display all Accounts";
cout<<"8) Exit";
cout<<"Enter Choice: ";

case 1:
cout<<"Enter Balance for Account # "< cin >> bal;
checking[accNumC] = new Checking(accNumC+1, bal);

case 2:
cout<<"Enter Balance for Account # "< cin >> bal;
savings(accNumS) = new Savings(accNumS+1, bal);

case 3:
cout << "Which Checking Account: ";
cin >> acct;
cout <<"Amount of Deposit: ";
cin >> amt ;
(*checking [acct-1]) += amt;

case 4:
cout << "Which Checking Account"
cin >> acct;
cout <<"Amount of Withdrawl: "
cin >> amt;
(*savings[acct-1]) -= amt;

case 5:
cout << "Which Savings Account: ";
cin >> acct;
cout <<"Amount of Deposit: ";
cin >> amt ;
(*savings [acct-1]) += amt;

case 6:
cout <<"Which Savings Account"
cin >> acct;
cout <<"Amount of Withdrawl: ";
cin >> amt ;
(*savings [acct-1]) -= amt;

case 7:

case 8:

default:cout<"Invalid choice";
while(choice != 8);

Posted Date: 11/16/2012 7:18:16 AM | Location : United States

Your posts are moderated
Related Questions
I need to make a fractal trees in OpenGL C++ . The method used is to write a recursive function with cylinders of different sizes and angles to create the tree trunk and branches.

- Create a program that uses at least two functions that will be called from your main. This program is a number game program that asks for parts of your phone and after manipulati

write a c++ program to update employee records

Write a Program that illustrate Command Line Parameters? main(int argc, char *argv[]) { int i; for(i = 0; i printf("arg %d: %s\n", i, argv[i]); return 0; }

Many modern cryptography algorithms require two numbers that are coprime, or sometimes referred to as relatively prime. Two numbers are coprime if their greatest common divisor is

I require a flowchart for push , & pop operation on stack using array

C program to demonstrate Pointer to string: void main() {                 int a;                 char str[]="hello how are you?",*ptr_str;                 ptr_str=&

/*  THIS PROGRAM IS TO ASK USER TO INPUT TWO DATE & PRODUCE A NEW DATE  */ #include #include struct date  {   int dd;   int yy;   int mm;  }; date add(date d1,date d2)    {

Explain about the Integer constants in c language? An integer constant is the integer valued number and it refers to a sequence of digits. A decimal integer constant includes o

E v o l u t i o n of Software: In the past stage of programming the software's were developed in Machine language Using binary numbers 1's and 0's.  Later it convert