Accounts, C/C++ Programming

Assignment Help:
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

#include
#include
#include

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

do{
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: ";
cin>>choice;
}
switch(choice){

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

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

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

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

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

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

case 7:
Account::print;
break

case 8:
break;

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

}

Related Discussions:- Accounts

Area Under Curve, Write a program to find the area under the curve y = f(x)...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Encoding and decoding, program for decode the encoded numbering format into...

program for decode the encoded numbering format into message

Padovan string, padovan string for n natural numbers p(n)=1,p(n)=2,p(n)=3 a...

padovan string for n natural numbers p(n)=1,p(n)=2,p(n)=3 and use padovan formul to get output 1

Lua and C++ sprite animation, How would I use variables of a C++ object wit...

How would I use variables of a C++ object within a Lua function, and then call the Lua function from C++ code?

Pebble merchent problem, There is a pebble merchant. He sells the pebbles, ...

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

Is it possible to create your own header files, Is it possible to create yo...

Is it possible to create your own header files? - Yes, it's possible to create a customized header file. - To do this, you just need to include function prototypes that you

Arrays within a class, A r r a y s w i t h i n a c l a s s:...

A r r a y s w i t h i n a c l a s s: I t i s j u s t d ecl a r i n g o r c on s t ru c ti n g a d e r i v e d t

Calculate the average assignment grade, 1. The main program must be in a fi...

1. The main program must be in a file called A4.cpp 2. The data must be read in from a data file.  The user must enter the filename.  A sample data file will be provided on Mood

Write a c program to calculate the equation, Write a C program to calculate...

Write a C program to calculate the output Y for a given value of X for the following formula   Y=X 2 + 2X +3   #include stdio.h   void main()   {   char promt;   float y,x

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd