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

C++ programming, I need help programing this... In this exercise, you will ...

I need help programing this... In this exercise, you will create a program for the sales manager at Computer Haven, a small business that offers motivational seminars to local comp

C++ Program Please see where i do mistake, #include #include #include ...

#include #include #include #include #include class Employee { private: char *Name; //Set them as pointers... int IdNumber; char *Department; char *Position; public: voi

Explain destructors, Destructors A destructor function gets implemented...

Destructors A destructor function gets implemented whenever an instance of the class to which it belongs goes out of existence. The primary usage of a destructor function is

Define the classification of operators in c language, Define the Classifica...

Define the Classification of Operators in C Language? Depending on the function performed the operator can be classified as 1. Arithmetic Operator 2. Logical Operator 3. Inc

How private instance of a class can be assigned values, Question 1: (a)...

Question 1: (a) Explain clearly the following concepts using suitable examples of your own:- (i) concrete class v/s abstract class (ii) constructor v/s over

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

a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b.   #include float start_point, /* G

Implement the c++ code in assembly language, Selecting Array Elements Imple...

Selecting Array Elements Implement the following C++ code in assembly language, using the block-structured .IF and .WHILE directives. Assume that all variables are 32-bit signed in

Arrys, Write a program that allows user to enter number of elements in an a...

Write a program that allows user to enter number of elements in an array. The program then allows user to enter the elements. Write a function called max that returns the position

Program for metric conversions, Write a program called Converter that does ...

Write a program called Converter that does three types of metric conversions. Your program should prompt the user for the selection conversion, prompt for input data, and display t

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