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

Stuck with a difficult assignment? No time to get your paper done? Feeling confused? If you’re looking for reliable and timely help for assignments, you’ve come to the right place. We promise 100% original, plagiarism-free papers custom-written for you. Yes, we write every assignment from scratch and it’s solely custom-made for you.


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’ve proficient writers who can handle both short and long papers, be they academic or non-academic papers, on topics ranging from soup to nuts (both literally and as the saying goes, if you know what we mean). We know how much you care about your grades and academic success. That's why we ensure the highest quality for your assignment. We're ready to help you even in the most critical situation. We're the perfect solution for all your writing needs.

Get a 15% discount on your order using the following coupon code SAVE15


Order a Similar Paper Order a Different Paper