Do the following tasks:
Task 1
Create an enumerated type named AccountType for representing different types of bank accounts (checking and savings). You will create two variables by using this enum type, and set the values of the variables to Checking and Deposit.
Task 2
Design a class named BankAccount that includes the following members:
• A string value contains account number.
• A decimal value contains account balance.
• An AccountType variable contains account type. AccountType is enumeration that is defined in the previous task.
• Populate() method to set value for each instance variable. This method will return void and expect two parameters: a string (the account number) and a decimal (the account balance). The accType field will be set to AccountType.Checking.
• Properties to get value of each instance variable.
• Withdraw() method will take a decimal parameter and will deduct the given amount from the balance. However, it will check first to ensure that sufficient funds are available, since accounts are not allowed to become overdrawn. It will return a bool value indicating whether the withdrawal was successful.
• Deposit() method will also take a decimal parameter whose value it will add to the balance in the account. It will return the new value of the balance.
Task 3
Create a class named CreateAccount that includes the following static methods:
• NewBankAccount() returns a new instance of BankAccount class. The method will write a prompt to the console prompting the user for the account number and account balance, and then call the Populate() method, passing the account number and account balance as arguments.
• Write() displays information of a BankAccount object. This method will return void and expect one parameter: a BankAccount object.
• TestWithdraw() returns void and expect a BankAccount parameter. The method will write a prompt to the console prompting the user for the amount to withdraw, capture the entered value amount as a decimal, and then call the Withdraw() method on the BankAccount parameter, passing the amount as an argument. The method will capture the bool result returned by Withdraw and write a message to the console if the withdrawal failed.
• TestDeposit() returns void and expect a BankAccount parameter. The method will write a prompt to the console prompting the user for the amount to deposit, capture the entered amount as a decimal, and then call the Deposit() method on the BankAccount parameter, passing the amount as an argument.
Using the following Main() method to test your tasks.
BankAccount berts = CreateAccount.NewBankAccount();
CreateAccount.Write(berts);
Console.WriteLine();
CreateAccount.TestDeposit(berts);
CreateAccount.TestWithdraw(berts);
Console.ReadLine();
Thanks so much !