You are on page 1of 42

UCDF1505ICT TP036551

INDIVIDUAL ASSIGNMENT
TECHNOLOGY PARK MALAYSIA
AAPP004-3-2-JP
JAVA PROGRAMMING

Name: Student No:


Ozhakayev Azamat TP036551

Intake: UCDF1505ICT
Name of Lecturer: Tanveer Khaleel Shaikh
Submission date: 13th April 2017

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Contents
Introduction................................................................................................................................3
Assumptions...............................................................................................................................3
Sample code with some explanation..........................................................................................3
Inheritance / Generalization...................................................................................................3
Adding a new client...............................................................................................................5
Try catch block.......................................................................................................................5
Login page authentication......................................................................................................6
Delete client...........................................................................................................................7
Additional features.....................................................................................................................7
Sample outputs with explanation...............................................................................................9
Main menu and Login............................................................................................................9
Staff......................................................................................................................................12
Client....................................................................................................................................32
Coach....................................................................................................................................33
Conclusion................................................................................................................................41
List of references......................................................................................................................42
References for images in MainMenu.java...........................................................................42

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Introduction.
Nowadays, information technology becoming more modern. Moreover, within past 10
years computers have become an important detail in system managements of all types
businesses. Management software is a general phrase used to describe a category of computer
software designed to help streamline the complexity of large projects and tasks as well as
facilitate team collaboration and project reporting. Most management software solutions can
also handle resource and employee management, schedule coordination, task assignment,
budgeting, time and risk analysis and more. (Webopedia. 2017). Management software that
has been created by Java programming language become more efficient these days. In this
assignment we are going to develop a Sport Class Fees Management System which will be
used for a sport center using Java programming language and NetBeans IDE.

Assumptions.
System will be developed using Netbeans IDE.

All users must log in to a system, this feature is for security purpose.

Staff will be able to Add/Modify/Delete/Search/View Customers and Clients by


using proposed system.

Proposed system will help Staff to charge customers and help to Client to make
payment.

Validation will done for each input field in order to avoid logical errors.

All details will be saved in .CSV (comma separated value) files.

Sample code with some explanation.


Inheritance / Generalization.

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

For inheritance concept has been used 4 java classes which is: User.java, Staff.java,
Client.java and Coach.java
Class diagram:

Figure 3.1 (Sport Class Fees Payment System)


In this case User is a superclass and Client, Coach and Staff classes are subclasses. To
define a subclass of User has been used keyword extends (Figure 3.2).

Figure 3.2 (Sports Class Fees Payment System)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Adding a new client.


To add a new client has been used addClient() method from Client.java (Figure 3.3)
class and Register button in addClient.java form.

Figure 3.3 (Client.java 2017)


addClient.java form creates a new object called clnt and passes a values to it using
constructor method.. Then, addClient() method takes a writer from addClient.java form and
writes values to a Client.csv file, using separator ~ (Figure 3.4).

Figure 3.4 (addClient.java 2017)

Try catch block.


Example of try and catch block for File Not Found (Figure 3.5).

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Figure 3.5 (Client.java 2017)


In this code checkClient() method gets a string value ID and component from a caller.
In try block, we are creating a new BufferReader, if file does not exist, catch block going to
catch FileNotFoundException, and display error message. Moreover, if there is another
error which is not defined in exception, second catch block will catch IOException, and
display error message. For finally block, it will try to close BufferReader.
Login page authentication.
For login page has been used try-catch and if-else statements (Figure 3.6).

Figure 3.6 (loginClient.java 2017)


In this block of code, try block is going to users input, is it integer or not, if it is not an
integer then error message is going to appear. Moreover, there is a two objects which is CLM
(ClientMenu.java) and cl (Client.java). cl.searchUser(usr, this); passing the ID number to

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

check is it exist on system or not. CLM.welcomeClient(cl.getName()); is going to pass the


name of user to the next page.
Delete client.
First, to delete clients record has been used manipulation with lines in files (Figure
3.7).

Figure 3.7 (Client.java 2017)


Here, to delete a user, this method has been called from deleteClient.java form (Figure
3.8). This method gets a string value which is lineDelete and checks the equal line in file.
While searching it copies the not equal lines to a temporary file. Once it finds equal line, it
skips that line. Finally, it renames a temporary file to Client.csv.

Additional features.
First of all, as an additional feature has been used an Arraylist. It is a class which
implements List interface. It is widely used because of the functionality and flexibility it
offers (Beginnersbook.com. 2017). Here is an example of Arraylist (Figure 4.1).

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Figure 4.1 (Client.java)


In this code, we are creating one list from many string variables.

The second feature is CSV files. A CSV file is a way to collect the data from any table
so that it can be conveyed as input to another table-oriented application such as a relational
database application. Microsoft Excel, a leading spreadsheet or relational database
application, can read CSV files. A CSV file is sometimes referred to as a flat file
(SearchSQLServer. 2017). This type of file has been used for to store the data in this system.

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Sample outputs with explanation.


Main menu and Login.
The very first output of is program is Main Menu (Figure 5.1) which is created by using
swing concept in Java.

Figure 5.1 (MainMenu.java 2017)


In this part User should choose as whom he/she wants to log in. There has been used
some animation, like when you cursor is over the button the appropriate panel will change its
colour to a grey (Figure 5.2). For example, when User press Login as Staff button it will go
to login page for staff and so on.

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Figure 5.2 (MainMenu.java 2017)


Login Staff page (Figure 5.3) is basically page where User can type his/her ID number
and Password to access the Staff Menu.

Figure 5.3 (loginStaff.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

The input validation is there for ID number field, this means User can input only
numbers for ID number field. Once User submits non-integer input it will show error (Figure
5.4).

Figure 5.4 (loginStaff.java 2017)


Moreover, if User submit incorrect ID number or Password, there will appear an error
message (Figure 5.5).

Figure 5.5 (loginStaff.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Only once User submits correct ID number and Password (Figure 5.6) it will go to the
Staff Menu, for this case correct credentials are: ID number: 10005, Password: asd123.

Figure 5.6 (loginStaff.java 2017)


Login Coach and Login Client have same concept as Login Staff. The difference is
Login Client and Login Coach are accessing the data from different files: Client.csv and
Coach.csv, while Login Staff is using Staff.csv file.
Staff.
After logging in as a staff will appear Staff Menu (Figure 5.7).

Figure 5.7 (StaffMenu.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Pressing any button will go to appropriate page. Pressing Log Out will go back to the
Main Menu. First of all, once User click on Add New Client button it will go to New
Customer Registration page (Figure 5.8).

Figure 5.8 (addClient.java 2017)


Input validation is applied here for two causes:
1) All fields must be filled up. Example: missing Full Name field (Figure 5.9).

Figure 5.9 (addClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

2) Number Validation for ID number and Phone Number. Example: inputting string to Phone
Number field (Figure 5.10)

Figure 5.10 (addClient.java 2017)


Moreover, it will check the availability of ID number, because ID must be unique for
each Client. If User tries to add a new Client with ID which is already exist in system, it will
show an error (Figure 5.11).

Figure 5.11 (addClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Once all field are filled up, for ID and Phone are typed only numbers and if ID Number
is available, then new client will be registered and will be shown appropriate message (Figure
5.12).

Figure 5.12 (addClient.java 2017)


Moreover, if user clicks on clear button all fields will be empty (Figure 5.8). And back
button will go to Staff Menu (Figure 5.7).
In Staff Menu (Figure 5.7) when user clicks on View Clients button, the Search or View
Customer page (Figure 5.13) will appear.

Figure 5.13 (viewClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Once User clicks on View ALL button all customers details will appear on table
(Figure 5.14).

Figure 5.14 (viewClient.java 2017)


For ID number field there is input validation, if User inputs non-integer value and click
Search, error message will appear (Figure 5.15).

Figure 5.15 (viewClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

In addition, user check is also there. For example, when user submits not existing
Clients ID, error will appear (Figure 5.16).

Figure 5.16 (viewClient.java 2017)


Moreover, once User submits existing Clients ID, table will show client details (Figure
5.17)

Figure 5.17 (viewClient.java 2017)


Back button will open back the Staff Menu.

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Next, if user clicks on Search Client button, it will open the Search Client page
(Figure 5.18).

Figure 5.18 (searchClient.java 2017)


Validation is also applied here like before for search button (Figure 5.19).

Figure 5.19 (searchClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

In addition, if user puts an ID which is not exist in system, then error message will
appear (Figure 5.20).

Figure 5.20 (searchClient.java 2017)


Once user search an existing user, then text field will be filled up by Clients details
(Figure 5.21).

Figure 5.21 (searchClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Once User clicks on back Button, then it will display the Staff Menu. On Staff Menu
next option is Modify or Delete Customer (Figure 5.22).

Figure 5.22 (modifyClient.java 2017)


Number validation on ID number field (Figure 5.23).

Figure 5.23 (modifyClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Check existing user is also applied here (Figure 5.24)

Figure 5.24 (modifyClient.java 2017)


Once user enters a correct ID number, then all fields will be filled up appropriately
(Figure 5.25).

Figure 5.25 (modifyClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

After that, once some changes is applied then click on Modify button, the information
message will appear (Figure 5.26).

Figure 5.26 (modifyClient.java 2017).


To delete customer user needs to enter a correct ID and press Delete button, then
success message will be displayed (Figure 5.27).

Figure 5.27 (modifyClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Back button will go back to a Staff Menu. The next function is Add New Coach
(Figure 5.28).

Figure 5.28 (addCoach.java 2017)


All validation same as in addClient.java (Figure 5.8). To add a new customer user
needs to fill up all details and press Register button, then success message will appear (Figure
5.29).

Figure 5.29 (addCoach.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Clear button will make all fields empty (Figure 5.28). Back button will display Staff
Menu. The next function for staff is View Coach (Figure 5.30).

Figure 5.30 (viewCoach.java 2017)


Once user clicks on View ALL button, all existing coach detail will appear in table
(Figure 5.31).

Figure 5.31 (viewCoach.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

In this form, Search function has all types of validation as same as in View Client.
Once user types correct ID and clicks on Search button, there, in table will be displayed only
that particular coach that user has been searching for (Figure 5.32).

Figure 5.32 (viewCoach.java 2017)


Back button goes to Staff Menu. The next function is Search Coach (Figure 5.33).

Figure 5.33 (searchCoach.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Here, for search function, has been applied all validations like in Search Client page.
To search, user needs to input correct ID and click Search button, then success message will
be displayed (Figure 5.34).

Figure 5.34 (searchCoach.java 2017)


Back button will display Staff Menu. Next feature for staff is Modify or Delete
Existing Coach (Figure 5.35).

Figure 5.35 (modifyCoach.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

In this form, has been applied all types of validation to avoid logical error like in
Modify or Delete Client form. To modify existing coach, user needs to type correct ID and
click on Search button, then all fields will fulfil with appropriate data (Figure 5.36).

Figure 5.36 (modifyCoach.java 2017)


After that, change some details there and click on Modify button (Figure 5.37).

Figure 5.37 (modifyCoach.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

To delete a coach, used needs to input correct ID number and click on Delete button,
then appropriate message will appear (5.38).

Figure 5.38 (modifyCoach.java 2017)


Back button will display Staff Menu. The next function is Charge Client (Figure 5.39)

Figure 5.39 (chargeClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Number input validation is also applied here for both fields (Figure 5.40).

Figure 5.40 (chargeClient.java 2017)


Check user for existing is also applied (Figure 5.41).

Figure 5.41 (chargeClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Once user inputs correct ID the fields will be filled up (Figure 5.42).

Figure 5.42 (chargeClient.java 2017)


After that, user enters an Amount that user wants to charge, then click on Confirm
Button, then receipt will appear (Figure 5.43).

Figure 5.43 (chargeClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Back button will display Staff Menu. Next function of staff is Make Payment (Figure
5.44).

Figure 5.44 (makePayment.java 2017)


Validation and check user for existing is also applied here as same as in Charge Client
page. To make a payment user just needs to enter an ID and Amount that client paid to staff,
then press Confirm. After that, receipt will be displayed (Figure 5.45).

Figure 5.45 (makePayment.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Client.
The next form is Client Menu (Figure 5.46).

Figure 5.46 (ClientMenu.java 2017)


The important function of client menu is View Outstanding, which allows Client to
check his/her outstanding balance (Figure 5.47).

Figure 5.47 (ClientMenu.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Coach.
The next form is Coach Menu (Figure 5.48) which consists all functions of Coach.

Figure 5.48 (CoachMenu.java 2017)


The first function of Coach Menu is View Outstanding of Client(Figure 5.49).
Validation and check for user existing is initialized here like in Search Client form.

Figure 5.49 (coachChargeClient.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Once user enters a correct ID number and clicks on Search button, then fields below
will be filled up appropriately (Figure 5.50).

Figure 5.50 (coachChargeClient.java 2017)


Back button will display Coach Menu. The next function of coach is Upload Matches
(Figure 5.51).

Figure 5.51 (addMatches.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

To proceed user needs to fill up all fields. Otherwise, error message will appear
(Figure 5.52).

Figure 5.52 (addMatches.java 2017)


To upload a new match timing, user just need to fill up all requirements (Figure 5.53).

Figure 5.53 (addMatches.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

The next form is Upload Schedule (Figure 5.54). Validation is also applied here like in
Upload Matches.

Figure 5.54 (addTimetable.java 2017)


To upload a schedule user should enter appropriate data, then click on Upload button.
After that appropriate message will appear (Figure 5.55).

Figure 5.55 (addTimetable.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

The next function is Remove Matches which will remove all uploaded matches
(Figure 5.56).

Figure 5.56 (CoachMenu.java 2017)


Once user clicks on yes, the success message will appear (Figure 5.57).

Figure 5.57 (CoachMenu.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

The next function is Remove Schedule which will remove whole uploaded schedule
(Figure 5.58).

Figure 5.58 (CoachMenu.java 2017)


Once user clicks on yes, the success message will appear (Figure 5.59).

Figure 5.59 (CoachMenu.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

The next function is View Matches, which allows to view uploaded matches to all
users (Staff, Coach, Client) (Figure 5.60).

Figure 5.60 (viewMatches.java 2017)


Once user clicks on View ALL button, matches will be displayed on table (Figure
5.61).

Figure 5.61 (viewMatches.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

The next function is View Matches, which allows to view timing for sport classes to
all users (Staff, Coach, Client) (Figure 5.62).

Figure 5.62 (viewTimetable.java 2017)


Once user clicks on View ALL button, sport class schedule will be displayed on table
(Figure 5.63).

Figure 5.63 (viewTimetable.java 2017)

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

Besides that, File Not Found exception has been added to all forms, which will show
error message if file is not found.

Conclusion.
To sum it all up, the proposed system has been created using Java programming
language. All required concepts included in this code. Besides that, the proposed system
should reduce the most paperwork in sport or fitness centres. Moreover, this system is more
comfortable for clients. Because, they will check their outstanding fees, view timetable and
matches at home, rather than asking staff every time. Payment issue is also solved. However,
this system needs to be tested on real business environment, then if there some bugs or errors,
need to update and solve emerging problems.

Asia Pacific University of Technology and Innovation


UCDF1505ICT TP036551

List of references.
Webopedia. 2017. What is management software. [ONLINE] Available
at: http://www.webopedia.com/TERM/M/management_software.html. [Accessed 12 April
2017].

Beginnersbook.com. 2017. ArrayList in java with example programs - Collections


Framework. [ONLINE] Available at: http://beginnersbook.com/2013/12/java-arraylist/.
[Accessed 12 April 2017].

SearchSQLServer. 2017. What is comma-separated values file (CSV)? - Definition from


WhatIs.com. [ONLINE] Available at: http://searchsqlserver.techtarget.com/definition/comma-
separated-values-file. [Accessed 12 April 2017].

References for images in MainMenu.java

Pinterest. 2017. 17 Best images about Coach on Pinterest | Trainers, Icons and Circles.
[ONLINE] Available at: https://www.pinterest.com/kevin6774/coach/. [Accessed 11 April
2017].

The Loud House Encyclopedia. 2017. Albert | The Loud House Encyclopedia | Fandom
powered by Wikia. [ONLINE] Available at: http://theloudhouse.wikia.com/wiki/Albert.
[Accessed 11 April 2017].

The Pendleton Panther. 2017. College Prep | The Pendleton Panther. [ONLINE] Available
at: https://pendletonpanther.wordpress.com/category/pendleton/college-prep/. [Accessed 11
April 2017].

Asia Pacific University of Technology and Innovation

You might also like