Programming Project #7 Banking Project Design and implement a hierarchy inherita
ID: 3866762 • Letter: P
Question
Programming Project #7 Banking Project Design and implement a hierarchy inheritance system of banking, which includes Savings and Checking accounts of a customer. Inheritance and virtual functions must be used and applied, otherwise, there is no credit. The following features must be incorporated: 1. The account must have an ID and customer’s full name and his/her social security number. 2. General types of banking transactions for both accounts, Checking and Savings: withdraw, deposit, calculate interest (based on the current balance, and if it was not modified, there will be no new interest), figure out the balance, and transfer funds (between the two accounts, from Checking to Savings and vice versa). 3. Savings restrictions: Become inactive if the balance falls less than $25, and under such situation, no more activities may be allowed. Also the resulted balance that goes below $25 is not accepted. A $1 charge for each transfer fund (to Checking account), with the first transfer is free. The monthly interest rate is 3.75%. 4. Checking restrictions: A monthly service charge is $5 (automatically be charged when Checking account was opened). A 10 cents charge for each written check, with the first check is free. A $15 charge for each bounced check (not enough funds). The monthly interest rate is 2.5%.
Explanation / Answer
#include <iostream>
using namespace std;
class Account {
int id;
String name;
int security_number;
double balance;
public:
Account()
void withdraw();
void deposit();
void calculateIntrest();
friend void printBalance();
void setBalance( double wid );
};
Account::Account( int localId,String person_name, int ss_number , double openingAmount) {
id = localId;
name = person_name;
security_number = ss_number ;
balance = openingAmount;
}
// Member function definition
void Account::setBalance( double openingAmt ) {
balance = openingAmt;
}
// Note: printWidth() is not a member function of any class.
void printBalance() {
cout << " Account Balance : " << balance <<endl;
}
class SavingAccount : public Account {
public:
};
class CheckingAccount : public Account {
public:
};
// Main function for the program
int main( ) {
Account account(1,"Deepak",101,20000);
account.printBalance();
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.