Design a bankAccount using object oriented programming. Design and implement the
ID: 3545396 • Letter: D
Question
Design a bankAccount using object oriented programming. Design and implement the following classes: Date, Person, and BankAccount.
Date has three members: month, day and year and a set of most used methods on a date.
Person has a name a birth date a social security number.
BankAccount has a holder (a person), the date of creation, interest rate and balance; it provides accessors and mutators of your choice and methods to to create, delete, modify or display an account given the name or the ssn of the holder or an account number.
Write a small program (main) than uses these objects and allows the creation of a least 10 accounts, and allows basic operations on bank accounts example modify, delete a account.
Explanation / Answer
As you have not mentioned it very clearly how the functions have to be present , i have just implemented the basic class , now you can modify it as you like it .
#include<iostream>
#include<stdio.h>
using namespace std;
class Account {
public :
int da , mo , yr;
int ssn;
int dc , ra , ba;
void BirthDate() {
cout << "Enter Date :"<< endl;
cin >> da;
cout << "Enter Month :" << endl;
cin >> mo;
cout << "Enter Year :" << endl;
cin >> yr;
}
void Person() {
cout << "Enter SSN :" << endl;
cin >> ssn;
}
void BankAccount() {
cout << "Date of Creation :" << endl;
cin >> dc;
cout << "Intrest Rate :"<< endl;
cin >> ra;
cout << "Balance :" << endl;
cin >> ba;
}
};
int main()
{
Account obj;
obj.BirthDate();
obj.Person();
obj.BankAccount();
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.