java programmer only
Liem Le | COSC2436 #1
School of Engineering and Technology
COSC2436 – PROJECT
Title Data structure – Bank Service
Time to
complete Nine weeks
COURSE OBJECTIVES
LEARNING OUTCOME LAB OBJECTIVES
-Apply Object Oriented programming
-Complete the lab on time (Time
Management)
-Do the lab by following the project process:
analysis, design, write the code, test, debug,
implement
-UML of data type class
-Write comments
-Write the code of data type classes
including data members, no-argument
constructor, parameter constructors,
mutator methods, assessor methods,
toString and other methods
-INHERITANCE: write the code of child
classes including, data members,
constructors and other methods inherited
from parent class
-apply Polymorphism: using object of the
parent class to point to object of child
classes
-control structure: if..else, switch, do..while
-create object, access members of data type
class
-format the output in columns and double
numbers with 2 decimal digits
-display message box
- create one of the data structure types:
UnsortedOptimizedArray, Restricted Data
Structures: Stack and Queue, Linked List,
Hashed, Tree
-Create a new project, add source file to the project, compile
and run the program without errors and qualified to the
requirement
-Declare variables of int, double, String;
-provide UML of data types
-Create data types with data members, constructors, mutator
methods
-Apply Inheritance relationship
-Apply polymorphism in the project
-provide the pseudo-code of program
-create and manage the menu to loop back to re-display after
each task: using do.. while
-Use switch statement to determine and define the action for
each task
-Format the output in columns and double numbers wiwth 2
decimal digits
-Display message box
-can create a data structure of UnsortedOptimizedArray,
Restricted Data Structures: Stack and Queue, Linked List,
Hashed, Tree
-can process all operations of UnsortedOptimizedArray,
Restricted Data Structures: Stack and Queue, Linked List,
Hashed, Tree
-can access data in file .xlxs
Liem Le | COSC2436 #2
Skills
required to
do the Lab
To do this lab, students have to know:
-Review to create the pseudo-code or a flowchart of a lab
-Review the syntax to create a data type class with data members, constructors, mutator
accessor methods, method toString
-Review how to define a child class including data member, constructor, toString and other
methods inheriting from parent class:
-Review how to declare an object in main(), how to access the methods of data type classes
from main()
-Review how to apply polymorphism
-Review control structure: if..else, switch, do..while loop
-How to set the decimal digits (2) of a double number
-How to display the message box
-How to access on each operation of UnsortedOptimizedArray, Restricted Data Structures:
Stack and Queue, Linked List, Hashed, Tree
-How to access file .xlxs
HOW TO DO
EACH PART
*Step1: Create the pseudo-code [QA2]
*Step2: Write the code
-start editor create the project, add .java file [QA1b] or [QA1d]
-follow the pseudo-code and use java to write the code of the program
*Step3: compile and run the program
*Step4: debug if there is any errors to complete the program
PROJECT
Requirement – COSC2426_FA2018_BANK SERVICE APPLICATION
A bank asks for an application for their bank service. That can help bank employees and bank
customers to do some tasks relating to their bank service.
The application should keep the information of Bank Customer including customer id (String
or a number), lastname(String), firstname(String), user name(String), password(String),
address (String) and a list of accounts that keeps all bank accounts (java LinkedList)
Besides the constructors, the class of Bank Customer should have some methods that relates
to some actions of a bank customer, for example, open one new account, close one account,
read one account, method to write information of customer to an output file, method to print
the bank customer information that lists customer’s name, id, address, and the list of all
accounts in the following format (for example):
Liem Le | COSC2436 #3
Beside Bank Customers, the application needs to manage Bank Accounts that need:
-Class BankAccount has account number (String) and balance (float)
-Class BankCheckingAccount inherits account number(String) and balance (float) from class
BankAccount and also have limitAmount (float) that is smallest amount of money in the
account and serviceFee(float)
-Class BankSavingAccount inherits account number (String and balance (float) from class
BankACcount and also have limitAmount (float) and interestRate(float)
-These classes should have constructors, method check balance, deposit, withdraw, print
monthly statement, toString and method write to file
Each Bank Customer has several accounts; either Checking account or Saving account.
Therefore, in the class Bank Customer, you can use java LinkedList as a data member to hold
all account that customer has
The project will keep BankCustomer as nodes and place them to a data structure type when
the project starts. You can select any type of data structure that we learned from the course
(UnsortedOptimizedArray, Singly LinkedList, Hashed, OR Tree) ➔ Therefore, you should
provide the class of the selected data structure
TOTAL YOU HAVE at least 6 CLASSES INCLUDING THE DRIVER CLASS: class of
BankCustomer_yourLastName, Account_yourLastName, CheckingAccount_yourLastName,
SavingAccount_yourLastName, class of data structure type and the driver class named
BankService_yourLastName
Suppose that the Bank stores all the information of Bank Customers in an Excel file
bankCustomers.xlsx (downloaded from eCampus)
Before running the program, you have to open the file bankCustomers.xlsx then Save As with
the extension is csv ➔ bankCustomers.csv
(Note: When you read the file with the extension .csv the information of all cells in each row
will be separated by comma “,”
For example:
222,Smith,James,bbb,bbb,djkf dkjfdjkfd,1850191232,2000.0,20.0,10.0,1389701422,500.0,100.0,.0005,
Liem Le | COSC2436 #4
The Bank Service application is for the bank emploees and the bank customers
1. FIRST, OPEN INPUT FILEE (bankCustomer.csv) READ EACH LINE INCLUDING INFORMATION OF ONE CUSTOMER, SPLIT INFORMATION THEN CREATE A NODE OF BankCustomer AND INSERT THE NODE TO DATA STRUCTURE
AFTER READ ALL LINES TO INSERET TO DATA STRUCTURE, USE SHOW ALL TO SHOW ALL
NODES FROM DATA STRUCTURE BEFORE CONTINUE DISPLAY THE MAIIN MENJU
2. PROVIDE THE MAIN MENU
Display the main menu to allow users select the user type:
COSC2436 FA2018 BANK SERVICE APPLICATION
1. Bank Employee 2. Bank Customer 0. Exit
When users select 0 for exit: OPEN THE OUTPUT FILE WITH THE SAME NAME AS ABOVE INPUT
FILE (bankCustomer.csv) TO WRITE:
FOR EACH NODE OF A CUSTOMER IN THE DATA STRUCTURE, COMBINE THE INFORMATION OF
THE CUSTOMER TO ONE LINE THEN WRITE THE OUTPUT FILE IN THE SAME FORMAT WHEN
YOU READ AT THE BEGINNING FOR NEXT USE
(see the file bankCustomer.xlsx for the format of one line)
When users select 1 for Bank Employee, display the following menu:
TASKS FOR BANK EMPLOYEES
1. Add a New Customer – Open New Account 2. Display a Customer With All Accounts 3. Open New Account for Current Customer 4. Read One Account of One Customer 5. Remove One Account of Current Customer 6. Display all Customers with their accounts 7. Process Monthly Statement 0. DONE
When employees select 0 for DONE, re-display the main menu.
When users select 2 for Bank Customers, display the follow menu:
TASKS FOR BANK CUSTOMERS
1. Print Information of Customer 2. Check balance 3. Deposit 4. Withdraw 5. Print Monthly Statement 0. DONE
When users select 0 for DONE, you will re-display the main menu
Liem Le | COSC2436 #5
TASK FOR BANK EMPLOYEES:
TASK 1: Add a New Customer – Open New Account
-display message to ask for information to create a new customer with at least one account
opening. The account number should be generated randomly and check to ensure it is unique
in the system.
(Note: You can use a LinkedList to keep all account numbers. Every new account number
should be compare to all existing account number in this linked list. If the new account
number is the same an existing number, the program should generate different one.)
-insert the new customer to the data structure
TASK 2: Display a Customer With All Accounts
-Ask for customer id, then look for the customer in data structure.
-if cannot find the customer with the id, display the message: “Customer cannot be found”
-if the customer is found, display all the information of one Customer as below (using the
object to call the method to print all information and list of accounts from class
BankCustomer)
TASK 3: Read One Account of One Customer
-ask for how to login:
SELECT LOGIN TYPE
1.Customer id
2.User name and password
0.DO NOT CONTINUE
If user select customer id, ask and read customer id
If user select user name and password, ask and read username and password
-Using “id” or “username + password” to read (fetch) a customer from data structure (You
should provide two fetch methods, one fetch by id and one fetch by username+password)
-Ask and read the account number that users want to read
-Using a method in class BankCustomer to search for the account with the account number
-If account cannot be found, display message
-If account is found, display account information, by using toString
OR
Liem Le | COSC2436 #6
TASK 4: Open New Account for Current Customer
-ask for customer Id to find the correct customer from the data structure
-ask for account type and all information enough to create one account either Checking
account or Saving account
-create account (remember to apply polymorphism)
-add the new account to the list of account of this customer by call the method
addNewAccount of class BankCustomer to add an account to list of account
-display the message to verify add account complete
For example:
Open new Account for Customer with id: 7654321 SUCCESS
TASK 5: Remove One Account of Current Customer
-ask for customer id to find the correct customer from data structure
If the customer cannot be found, display message: “The customer with <id> does not exist”
If the customer is found:
-ask for account number that users want to delete
-if account cannot be found, display the message
-If account is found:
* if this customer only have one account and he want to close, display the message to let users
confirm:
This customer only have one account
Close this account will remove this customer off the system
Do you still want to close account (Y/N)?"
If he says N, do not close the account
If he says Y,
* remove the account by calling the method closeAccount of class BankCustomer
* remove account number from the list of account number
* Delete this customer from data structure
TASK 6: Display all Customers with their accounts
-show all the customer in the data structure, call the method showAll from data structure
TASK 7: Process Monthly Statement
-generate monthly statements of each account of all customer by calling the method process
the monthly statement from the class data structure
Liem Le | COSC2436 #7
TASK 0: DONE → go back to the menu to select User Type
TASKS FOR BANK CUSTOMERS
After users select the type as Bank Customers:
-ask users to select type to logging:
SELECT LOGIN TYPE
1.Customer id
2.User name and password
0.DO NOT CONTINUE
Ask for id or ask for username, password to look for customer
*If cannot find customer, display the message
*If the customer is found, display the information of the Customer as below:
Then display the menu of Tasks for Bank Customers:
TASKS FOR BANK CUSTOMERS
1. Print Information of Customer 2. Check balance 3. Deposit 4. Withdraw 5. Print Monthly Statement 0. DONE
Read one task and when finishing one task, you should re-display the menu to allow users to
continue to work with other tasks
Task 1: Print Information of Customer
-Print the information of the current customer by calling toString of class BankCustomer
TASK 2: Check balance
Liem Le | COSC2436 #8
-ask for account number
-display the current balance by calling the method of class BankAccount
(BankCheckingAccount, BankSavingAccount)
TASK 3: Deposit
-ask for account number
-ask for the amount to deposit
-call deposit method from the data type class to recalculate the new balance and display the
output for deposit
TASK 4: Withdraw
-ask for account number
-ask for the amount to withdraw
-call withdraw method from the data type class to recalculate the new balance and display the
output for deposit
* Note that the withdraw amount needs to check to ensure after withdraw the balance is not
less than limit amount. If it is not, display denied the do not reduce money
OR
TASK 5: Print Monthly Statement
Liem Le | COSC2436 #9
-ask for account number
-print the monthly statement of that account by call the method of class BankCustomer
The output of bank statement:
Account Name: Le, Liem
Account Number: 1567794657
Balance: 400.00
Service Fee: 10.00
End Balance: 390.00
OR
Account Name: Le, Liem
Account Number: 1567794657
Balance: 400.00
Interest Rate: 0.05%
Interest Amount: 0.20
End Balance: 400.20
TASK 0: DONE → go back to the menu to select User Type
You should turn in the following files:
Account_LastName.java
CheckingAccount_yourLastName.java
SavingAccount_yourLastName.java
BankCustomer_yourLastName.java
Data structure file
BankService_yourLastName.java
Account_LastName.class
CheckingAccount_yourLastName.class
SavingAccount_yourLastName.class
BankCustomer_yourLastName.class
Data structure file .class
BankService_yourLastName.class
-pseudo code
-UML of data type classes
Liem Le | COSC2436 #10
HOW TO
EVALUATE
THE
PROJECT
Turn in the project on time 8
Submit all files that need to run your project
Include file .class 2
compile success with all the requirements 10
UML of data type classes and pseudo-code 3
Write comments 4
class Data structure (you can choose any data structure type we
learned) that hold all the tasks we need for the project 2
Data type class BankCustomers that holds all the tasks relate to the
customer 4
Data type class Account, CheckingAccount, SavingAccount to hold the
information of accounts 4
Create data structure 1
Read input file, create the nodes, insert to the data structure 5
Display menu and handle to loop back all menu 2
Employee: TASK 1 new customer 2
Employee: TASK 2 read one customer 2
Employee: TASK 3 read one account of one customer 3
Employee: TASK 4 add new account of current customer 3
Employee: TASK 5 delete one account of current customer 3
Employee: TASK 6 process monthly statement for all customers 2
Employee: TASK 7 show all customer 1
Employee: TASK 0 open file to write – write success in correct format 5
Customer: TASK current balance 2
Customer: TASK deposit 2
Customer: TASK withdraw 2
Customer: TASK monthly statement 2
inheritance 3
Polymorphism 3
Project scores 80
Liem Le | COSC2436 #11
HOW TO
EVALUATE
THE
Liem Le | COSC2436 #12
Turn in the project on time 10
Submit all files that need to run your project
Include file .class 2
compile success with all the requirements 10
UML of data type classes and pseudo-code 3
Write comments 4
class Data structure (you can choose any data structure type we learned)
that hold all the tasks we need for the project
Data type class BankCustomers that holds all the tasks relate to the
customer 4
Data type class BankAccount, BankCheckingAccount, BankSavingAccount
to hold the information of accounts 4
Create data structure 1
Read input file, create the nodes, insert to the data structure 5
Display menu and handle to loop back all menu 2
TASK 1 new customer 2
TASK 2 read one customer 2
TASK 3 read one account of one customer 3
TASK 4 add new account of current customer 3
TASK 5 delete one account of current customer 3
TASK 6 process monthly statement for all customers 2
TASK 7 show all customer 1
TASK 0: open file to write – write success in correct format 5
TASK current balance 2
TASK deposit 2
TASK withdraw 2
Liem Le | COSC2436 #13
TASK monthly statement 2
inheritance 3
Polymorphism 3
Project scores 80
HOW TO
TURN IN