Question: Write a class Account to represent a bank account with the following members: Account = {type, accountHolderName, creationDate, balance, category} Note that type = checking

 Write a class "Account" to represent a bank account with the

Write a class "Account" to represent a bank account with the following members: Account = {type, accountHolderName, creationDate, balance, category} Note that "type" = checking or saving and "category" gold or silver Implement the following methods: 1) all constructors, tostring method, getters and setters. 2) functions AddMoney, RemoveMoney, CheckBalance, ShowTransactionHistory, showAllAccounts The main function should be something like this: //create an account and set the initial parameters Account my = new Account(); my.SetType("checking"); //account has only two types, checking/ saving my.SetAccountHolderName("Tariq"); my.SetCreationDate(8, 10, 2017); //this is the date when account is created my.SetBalance (3000); //this is the opening balance 1/Only two categories are allowed: Gold/Silver. /ote that if account balance is more than 100K, category should be Gold, otherwise Silver. /ow, lets call some functions on 'my' object my. AddMoney (4000); my. CheckBalance(); //display a balance of 7000 my. RemoveMoney (1000); my. CheckBalance(); //display a balance of 6000 my. ShowTransactionHistoryO; //displays a history of all the above //the above function ShowTransactionHistory() should display the following: //SAR 4000 added on 8/10/2017 //SAR 1000 removed on 8/10/2017 /ow lets create another account Account your = new Account(my); your.SetType("saving"); your.SetAccountHolderName ("Ahmed"); your.SetCreationDate(8, 10, 2017); my.SetBalance (200000); /ow print all the accounts created so far Account. ShowAllAccounts();//displays the following about all the accounts //Total accounts created = 2 //Total Silver members = 1 //Total Gold members = 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!