You are on page 1of 3

Data Structures and Algorithms COMP-254

COMP-254 009: Data Structures and Algorithms


Hands-On TEST 1

Be sure to read the following general instructions carefully:

- This lab test must be completed individually by all the students.


- Read the project naming and submission guidelines on page 3.
- Create 30 seconds video to record your output from console. You don’t need to explain
code in the video.

Question [10 Marks]

Create a simple banking system to manage customer accounts using a linked list data structure in
Java. The system should allow bank employees to perform operations such as opening accounts,
closing accounts, and displaying all account details. Implement the required functionality using a
linked list.

Your assignment should include the following components:

1. Account Class: Define a Java class named Account to represent a bank account. Each
account should have attributes such as an account number (accountNumber), an account
holder's name (holderName), a balance (balance), and an account status (status),
indicating whether the account is open or closed. Include appropriate constructors and
methods to access and modify account attributes.
2. AccountLinkedList Class: Create a Java class named AccountLinkedList to encapsulate
the functionality of the banking system using a linked list. Implement methods to open
accounts(openAccount), close accounts by their account number
(closeAccountByNumber), display all account details (displayAccounts), and any other
helper methods you deem necessary.
3. User Interface: Develop a simple console-based user interface to interact with the
AccountLinkedList class. Bank employees should be able to open accounts, close
accounts, and display all account details through a menu-driven interface.
4. Main Program: Write a main program that demonstrates the functionality of the
AccountLinkedList class. It should allow bank employees to continuously interact with
the banking system until they choose to exit.

Your implementation should handle scenarios such as opening accounts with duplicate account
numbers, closing accounts that do not exist, displaying an empty list of accounts, and gracefully
handling user input errors.

Ensure to write clean and well-documented code, including comments where necessary to explain
the functionality of each component.

Lab Test 1 Page 1 of 3


Data Structures and Algorithms COMP-254

Example Output:

Welcome to the Banking System!


1. Open Account
2. Close Account
3. Display Accounts
4. Exit
Enter your choice: 1
Enter account number: 1001
Enter account holder's name: Alice
Enter initial balance: 5000
Account '1001' opened successfully for Alice.
1. Open Account
2. Close Account
3. Display Accounts
4. Exit
Enter your choice: 1
Enter account number: 1002
Enter account holder's name: Bob
Enter initial balance: 7000
Account '1002' opened successfully for Bob.
1. Open Account
2. Close Account
3. Display Accounts
4. Exit
Enter your choice: 3
Account Details:
Account Number: 1001 | Holder's Name: Alice | Balance: 5000 | Status: Open
Account Number: 1002 | Holder's Name: Bob | Balance: 7000 | Status: Open
1. Open Account
2. Close Account
3. Display Accounts
4. Exit
Enter your choice: 2
Enter the account number to close: 1002
Account '1002' closed successfully.
1. Open Account
2. Close Account
3. Display Accounts
4. Exit
Enter your choice: 3
Account Details:
Account Number: 1001 | Holder's Name: Alice | Balance: 5000 | Status: Open
1. Open Account
2. Close Account
3. Display Accounts
4. Exit
Enter your choice: 4
Exiting the program. Goodbye!

Lab Test 1 Page 2 of 3


Data Structures and Algorithms COMP-254

Evaluation:
Correct implementation of requirements: 85%
• Correct data structure algorithm
• Correct Java implementation of methods
• Correct running time if required

Friendly and Correct test method 15%

Total 100%

You must name your IntelliJ project according to the following rule:
YourFullname_COMP254LabTest1.

Example: JohnSmith_COMP254_009LabTest1

Submission rules:

Submit your modules as zip files that are named according to the following rule:
YourFullname_ COMP254_009LabTest1.zip

Example: JohnSmith_ COMP254_009LabTest1.zip

Lab Test 1 Page 3 of 3

You might also like