Write C# equivalent statements for the following: An “Account” class will be created having properties: accountName, accountNumber, accountType, totalBalance and methods: WithdrawAmount(), CheckBlance(), DepositAmount(). Derive child classes, that is, “SavingAccount” and “CurrentAccount” from the Account class and implement the following functionality. While taking input from user, check whether the account type is Saving or Current. If user enters “Saving”, an object of Saving Account will be instantiated and while depositing amount in the account an extra 3% of the amount will be deposited (as an extra profit) with the actual amount entered by user. If user enters “Current”, an object of Current Account will be instantiated and while depositing amount in the account, no extra amount will be deposited. Only the actual amount will be deposited. Also implement all the methods mentioned above.
Write C# equivalent statements for the following:
An “Account” class will be created having properties: accountName, accountNumber, accountType, totalBalance and methods: WithdrawAmount(), CheckBlance(), DepositAmount(). Derive child classes, that is, “SavingAccount” and “CurrentAccount” from the Account class and implement the following functionality.
While taking input from user, check whether the account type is Saving or Current. If user enters “Saving”, an object of Saving Account will be instantiated and while depositing amount in the account an extra 3% of the amount will be deposited (as an extra profit) with the actual amount entered by user. If user enters “Current”, an object of Current Account will be instantiated and while depositing amount in the account, no extra amount will be deposited. Only the actual amount will be deposited. Also implement all the methods mentioned above.
Step by step
Solved in 4 steps with 2 images