Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in c++ BankAccount.h ------------------------------- #include using namespace std ; class BankAccount{ private : int ID; string Firstname; string Surname; char Acc_type; float Acc_balance; static int

in c++ image text in transcribed
BankAccount.h
-------------------------------
#include
using namespace std ;
class BankAccount{
private :
int ID;
string Firstname;
string Surname;
char Acc_type;
float Acc_balance;
static int TotalNumberofAcc ;//static
public :
BankAccount();
BankAccount(int ID,string Firstname,string Surname,char Acc_type,float Acc_balance);
BankAccount(Const BankAccount& b);
void setID(int);
void setFirstname(string);
void setSurname(string);
void setAcc_type(char);
void setAcc_balance(float);
int getID();
string getFirstname();
string getSurname();
char getAcc_type();
float getAcc_balance();
void print();
void Deposit(float d);
bool Withdraw(float w);
float enquiry();
void HolderName();
void DispNumAcc();
~BankAccount();
};
Using the class 'Bank Account defined in the assignment 2, modify it according to the following: 1. Remove data member "Bank Account Type (Current Account, Savings Account)" from the Bank Account class. 2. Modify the parameterized constructor to take balance as argument. 3. Add copy contractor B) Create an inheritance hierarchy where "Bank Account is the base class and "SavingAccount" and "CurrentAccount" are derived classes. With the SavingAccount, the Bank pays interest 4% each Year to the customer based on the account balance. With the Current Account, the Bank subtracts 1 JD as charges for each withdraw transaction 1. Initialise a SavingAccount and Current Account objects with an initial balance 100JD. 2. Write the code of "CalculateInterest' function for the SavingAccount class. It should calculate the interest yearly and add it to the balance. 3. Write the code of TransactionCharge" function for the Current Account class. It should deduct IJD from the balance after cach withdraws transaction. 4. Create a "FlexyAccount" class that drived from SavingAccount and Current Account 5. create Calculate Interest" function for the Flexy Account class, knowing that the interest rate is 1% 6. create TransactionCharge" function for the Flexy Account class, knowing that the charge for each withdraw transaction is 0.5 JD 7. Write the appropriate code for the destructor of each derived class. 8. Write the code of PrintBank" function for each derived class C) Write a program (main) that will do the following: 1. create a BankAccount object with 1000 JD in Balance 2. create a SavingAccount object with 400 JD in Balance 3. create a Current Account object with 2000 JD in Balance. 4. display the balance of SavingAccount object after one year, using PrintBank function, 5. display the balance of Current Account object after 10 withdraw transactions, using PrintBank function. 6. create a Flexy Account object with 800 JD in Balance 7. create a Flexy Account object using a copy constructor. 8. display the balance of Flexy Account object after 5 withdraw transactions performed during the last 3 months, using PrintBank function. Note that you should separate the interface form the implementation for all of your code. Using the class 'Bank Account defined in the assignment 2, modify it according to the following: 1. Remove data member "Bank Account Type (Current Account, Savings Account)" from the Bank Account class. 2. Modify the parameterized constructor to take balance as argument. 3. Add copy contractor B) Create an inheritance hierarchy where "Bank Account is the base class and "SavingAccount" and "CurrentAccount" are derived classes. With the SavingAccount, the Bank pays interest 4% each Year to the customer based on the account balance. With the Current Account, the Bank subtracts 1 JD as charges for each withdraw transaction 1. Initialise a SavingAccount and Current Account objects with an initial balance 100JD. 2. Write the code of "CalculateInterest' function for the SavingAccount class. It should calculate the interest yearly and add it to the balance. 3. Write the code of TransactionCharge" function for the Current Account class. It should deduct IJD from the balance after cach withdraws transaction. 4. Create a "FlexyAccount" class that drived from SavingAccount and Current Account 5. create Calculate Interest" function for the Flexy Account class, knowing that the interest rate is 1% 6. create TransactionCharge" function for the Flexy Account class, knowing that the charge for each withdraw transaction is 0.5 JD 7. Write the appropriate code for the destructor of each derived class. 8. Write the code of PrintBank" function for each derived class C) Write a program (main) that will do the following: 1. create a BankAccount object with 1000 JD in Balance 2. create a SavingAccount object with 400 JD in Balance 3. create a Current Account object with 2000 JD in Balance. 4. display the balance of SavingAccount object after one year, using PrintBank function, 5. display the balance of Current Account object after 10 withdraw transactions, using PrintBank function. 6. create a Flexy Account object with 800 JD in Balance 7. create a Flexy Account object using a copy constructor. 8. display the balance of Flexy Account object after 5 withdraw transactions performed during the last 3 months, using PrintBank function. Note that you should separate the interface form the implementation for all of your code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions