Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in this practical task, you will continue your work on developing the banking system that you began in Task 2.2. You will rene the functionality

image text in transcribed
in this practical task, you will continue your work on developing the banking system that you began in Task 2.2. You will rene the functionality of the Account class and add some important validation to its Hithdr'l' and Deposit methods. 1n addition, you will focus on the use of control flow in order to implement a primitive user interface {LII} for the program. Create a new C# Console Application project. You should import the Account class written earlier as part of Task 2.2. Another new class must replace the default Program class. Name it as Eiankystem. Its purpose is to test the Account class and also provide the UI to control the associated account. 1. Because the user must not be able to deposit a negative amount of money, you need to add a simple check to ensure that the input of the D'Epit method is greater than zero. indeed, the user must know whether the deposit operation was successful or not. This can be achieved by changing the output of the method. it should now return a value of type boo! {Boolean}. That is, if the amount to deposit is valid, then we change the _balance and return tr'ue to indicate that this succeeded. Returning false means that the deposit operation failed. The caller can then use the returned result for hisfher own purpose. Similarly, you must ensure that the user cannot withdraw more funds than hefshe has, and that a negative amount cannot be withdrawn. This will require you to alter the withdraw method of the class. 2. You now can focus on the Baniystem class to implement the LII so that the user gets the control over the affiliated bank account. Create a new enumeration, called Menuption, with the following options: 1. withdraw 2. Deposit 3. Print, and A. IQuit. Place this outside of the BankSystem class, i.e. either before or after the Bankystem class' code. Keep the options in this specific order as this way we know that Hithdnaw will map to the integer value Ell, Deposit will map to 1, Print will map to 2, and Quit will map to 3. Create HeadUser'Option, a new static method, that returns a result of type Menqution. This method will show the menu to the user and read in the choice hefshe made. It should contain a do while loop, show the user a prompt and use the Cnmle. ReadLinE along with the Convent.ToInt32 methods to read in the user's choice and convert it to an integer. The integer result should be recorded in a variable for later use. Note that the value entered by the user cannot be less than 1 or larger than A. The menu should keep asking the user to choose a valid option from the list until such option is entered. in other words, invalid codes must be ignored by the menu and it must repeat the possible options again. 'lhe ReadUserClption method must return a valid code that matches the enumeration

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Casebook On General Management In Asia Pacific

Authors: Dominique Turpin, Xiaobai Shen

1st Edition

0333717910, 978-0333717912

More Books

Students also viewed these General Management questions