Professional Documents
Culture Documents
Q) Write a VB program to implement a class called BankAccount that has three private member variables (
Account_owner, AccountNumber and Acount_Balance). The class has also two member functions and a
constructor. The constructor should initialize Account_owner = “Your Name”, AccountNumber= “Your
registration Number ” and Acount_Balance= 1000. The two member function are (Deposit and Withdraw) ,
these two functions take as an argument “amount” that is used to deposit and withdraw money from the
Acount_Balance.
Then create another class that inherit the BankAccount class and call it Admin_Account, This new class has one
private member variable (Admin_Name) and one member function (Close_Account) which used to set
Account_Balance to 0.
For each of these classes create one object
Use the BankAccount object to perform the following operation
Deposit 500 to the account
Withdraw 100 from the account
Print the Account_Balance
Use the Admin_Account object to close the account
Create the setters and getters functions for Account_Balance, Admin_Name variables .