BANKING OPERATION USING CLASS AND OBJECTS
Algorithm
Step 1: Create an object b of the class bank Account.
Step 2: Read the number of records.
Step 3: call the init member function of the class bank account through the object created.
Step 4: Assign 500 to the balance in the records.
Step 5: Display a menu with the following options create deposit withdraw display.
Step 6: Read the choice.
Step 7: If the choice is create then call the create member function using the object.
Step 8: prompt and read the user’s name, account number and account type for all the n records.
Step 9: If the choice is deposit call the deposit member function using the function.
Step 10: Read the account number.
Step 11: Check whether this account number is already exiting in the list. If true
Step 12: Read the amount to be deposited.
Step 13: Update the balance by adding the amount deposited to the balance.
Step 14: Display the balance.
Step 15: If the choice is withdraw, call the withdraw member function.
Step 16: Using object Read the account number.
Step 17: Check the account number existing in the list then.
Step 18: Read the amount to be withdrawn.
Step 19: Retrieve the amount from balance.
Step 20: If the balance is less than 500 then
Step 21: Calculate balance + withdraw amount-500.
Step 22: Assign 500 to the balance.
Step 23: Display the withdrawn amount.
Step 24: If the choice is display, invoke the display member function using the
Object.
Step 25: Read the account number.
Step 26: If this account number is existing in the list then.
Step 27: Display the details such as name, account number, account type and balance in the given account number.
No comments:
Post a Comment
Type Your Comment Here