Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class Bank
- {
- private:
- string myname;
- int number;
- double changes;
- double initialbal;
- double endingbal;
- public:
- Bank(string name=" ", int num=0, double c=0, double ibal=0, double ebal=0)
- {
- myname = name;
- number = num;
- changes = c;
- initialbal = ibal;
- endingbal = ebal;
- }
- void EnterName();
- void ShowName(void );
- void EnterNumber();
- void ShowNumber(void );
- void EnterChanges();
- void ShowChanges(void );
- void EnternComputeInitialBal(double );
- void ComputeEndinglBal(double );
- };
- void Bank::EnterName()
- {
- cout<<"Please enter your Account Name: ";
- getline(cin, myname);
- }
- void Bank:howName()
- {
- cout<<"\n\nAccount Name: "<<myname<<endl;
- }
- void Bank::EnterNumber()
- {
- cout<<"Please enter your Account Number: ";
- cin>>number;
- }
- void Bank:howNumber()
- {
- cout<<"Account No: "<<number<<endl;
- }
- void Bank::EnterChanges()
- {
- cout<<"Please enter positive amount to deposit and negative to withdraw: $";
- cin>>changes;
- }
- void Bank:howChanges()
- {
- cout<<"Enter positive amount to deposit and negative to withdraw: $"<<changes<<endl;
- }
- void Bank::EnternComputeInitialBal(double ibal)
- {
- cout<<"Enter inital balance : $"<<ibal<<endl;
- }
- void Bank::ComputeEndinglBal(double ibal)
- {
- endingbal=ibal+changes;
- cout<<"Ending balance : $"<<endingbal<<endl;
- }
- void main()
- {
- Bank bank;
- bank.EnterName();
- bank.EnterNumber();
- bank.EnterChanges();
- bank.ShowName();
- bank.ShowNumber();
- cout<<"Type: Saving "<<endl;
- bank.EnternComputeInitialBal(6000);
- bank.ShowChanges();
- bank.ComputeEndinglBal(6000);
- cout<<"Interest next month: $11.67"<<endl;
- cout<<"\n\n\n ^_^ Thank you for using this program ^_^ "<<endl;
- cout<<" Have a nice day "<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement