in C#, Define an abstract base class named BankAccount. Use theBankAccount class to derive a Savings

Swamped with your writing assignments? We'll take the academic weight off your shoulders. We complete all our papers from scratch. You can get a plagiarism report upon request just to confirm.


Order a Similar Paper Order a Different Paper

in C#, Define an abstract base class named BankAccount. Use theBankAccount class to derive a SavingsAccount and CheckingAcountclass with different rules for withdrawing funds. Create a newconsole-base project (CS3) and use the driver program providedbelow to test your class definitions. Name the classes as suggestedso it will work with the provided test program. The classes can bedefined in the program file (CS3.cs) before the Program class, soadditional class files are not necessary. BankAccount: DefineBankAccount as an abstract class. Declare a decimal variable tostore the account balance. Should be defined as protected to allowfor inheritance. Define an empty default constructor. Define anoverloaded constructor with a parameter of the type decimal, whichwill be used to pass an amount for the initial account balance.Assign the parameter amount to the class balance variable using theproperty’s set method (Balance = decBalance). Define a propertynamed Balance that sets and gets the current balance (typedecimal). Define a void method named deposit with a parameter ofthe type decimal which will be the amount of the deposit. Assumeall values are positive, so the amount does NOT need to bevalidated. Add the amount to Balance (property name). Define anabstract method that with a return type of int named withdraw witha parameter of the type decimal which will be the amount of thewithdrawal. This is an abstract method so it will not have a body,not even the open and closes braces. The implementation will bedefined by each class that is derived from this base class. In theimplementations, the methods will return an integer. A zero isreturned if the withdrawal was successful, or a one if the accounthad insufficient funds. public abstract int withdraw(decimaldecAmt); SavingsAccount: Declare a private decimal variable tostore the rate for the withdrawal fee. The fee is 10% (.10) of thetransaction amount. Initialize the rate for the withdrawal fee to.10m at declaration. Define a default constructor with an emptybody. Have it call the base constructor as part of the headerdeclaration. Define an overloaded constructor with a parameter ofthe type decimal, which will be used to pass an amount for theinitial account balance. As part of the method header, call theoverloaded constructor defined in the base class to assign theamount to the class balance variable. Define a method namedwithdraw to override the abstract method defined in the base class.It should have a parameter of the type decimal which will be theamount of the withdrawal. Before processing the transaction,calculate the withdrawal fee and add it to the transaction amount,and then verify there are sufficient funds in the account for thetotal transaction. The method should return an integer. A zero isreturned if the withdrawal was successful, or a one if the accounthad insufficient funds. The provided transfer method will check thereturned value. The function header should look something likethis: public override int withdraw(decimal decAmt) CheckingAccount:Declare a private integer variable to store the number ofwithdrawals. Initialize the number of withdrawals to zero atdeclaration. The first two withdrawals are free. For all others,there is $1.50 fee. Define a default constructor with an emptybody. Have it call the base constructor as part of the headerdeclaration. Define an overloaded constructor with a parameter ofthe type decimal, which will be used to pass an amount for theinitial account balance. As part of the method header, call theoverloaded constructor defined in the base class to assign theamount to the class balance variable. Define a method namedwithdraw to override the abstract method defined in the base class.It should have a parameter of the type decimal which will be theamount of the withdrawal. If is the transaction count is => 2,add the transaction fee to the withdrawal amount. If there aresufficient funds in the account to withdraw the entire amount,subtract the amount from the balance and increment the withdrawalcounter. The method should return an integer. A zero is returned ifthe withdrawal was successful, or a one if the account hadinsufficient funds. The provided transfer method will check thereturned value. The function header should look something likethis: public override int withdraw(decimal decAmt) . . .

Writerbay.net

We offer CUSTOM-WRITTEN, CONFIDENTIAL, ORIGINAL, and PRIVATE writing services. Kindly click on the ORDER NOW button to receive an A++ paper from our masters- and PhD writers.

Get a 10% discount on your order using the following coupon code SAVE10


Order a Similar Paper Order a Different Paper