Question: QUESTION 2 (30 MARKS) Use the Account class created in Question to simulate an ATM machine. Create ten accounts in an array with id 0,1.....9,

QUESTION 2 (30 MARKS) Use the Account class created in Question to simulate an ATM machine. Create ten accounts in an array with id 0,1.....9, and initial balance S100. The system prompts the user to enter an id. If the id is entered incorrectly, ask the user to enter a correct id. Once an id is accepted, the main menu is displayed as shown in the sample run. You can enter a choice for viewing the current balance, 2 for withdrawing money, 3 for depositing money, and 4 for exiting the main menu. Once you exit, the system will prompt for an id again. Thus, once the system starts, it will not stop Below is a sample run of the program Enter an id: 4 Main menu 1: check balance 2: withdraw 3: deposit 4: exit Enter a choice: 1 The balance is 100.0 Main menu 1: check balance 2: withdraw 3: deposit 4: exit Enter a choice: 2 Enter an amount to withdraw ) Main menu 1: check balance 2: withdraw 3: deposit 4: exit Enter a choice: 1 The balance is 97.0 Main menu 1: check balance 2: withdraw 3: deposit 4: exit Enter a choice: Enter an amount to deposit: 10 Main menu 1: check balance 2: withdraw 3: deposit 4: exit Enter a choice: 1 The balance is 107.0 Main menu 1: check balance 2: withdraw 3: deposit 4: exit Enter a choice: 4 Enter an id: Assignment Marking Scheme 1/3 marks - Proper documentation and readability of the program - Header documentation includes: Course Name, Student name, Student number, Assignment number and date completed. - There must be a general description of the purpose of the method/function used. - Appropriate comments: where necessary, within the method function, there should be inline comment descriptions of declaration of variables, statements, control structures and etc. to improve the readability of the program. - Properly named variables: well-chosen descriptive variable names make it easier for readers or analysts to understand what the intent of the variable or what the system is doing. Example: payRate =5.0 as oppose to x=5. Properly named variable can also avoid naming collision. - Properly named method/function: method name should imply the intent of the method and what the method is doing. - All identifier names should follow standard naming convention in Java. - Proper indentation and spacing in program improves readability. 1/3 marks - Programming language knowledge and skills - Demonstrate the use of concepts in Java such as: object-orientation, interface, package, class, exception and etc., learnt in the class. - Demonstrate the use of basic programming concepts. - Use of features not presented in the class must be relevant and properly commented. - Program shows a clear understanding of programming concepts in general. - Good programming practices and skills 1/3 marks - Program compile and run with correct output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
