You are on page 1of 37

FUNDAMENTALS OF SOFTWARE DEVELOPMENT

CT010-3-1-FSD
FSD GROUP ASSIGNMENT
UC1F1105 (IT)
MR. TAN KWONG HWEE
Group Members:
YEOH SENG JOO
ENG HON KHEONG

TP026131

Group Assignment

UC1F1105 (IT)

Table of Contents
Flow chart
Workload Matrix......................................................................................................... 5
Abstract.................................................................................................................... 6
Acknowledgement....................................................................................................... 7
Flowchart.................................................................................................................. 8
Source Code........................................................................................................... 9
Student Class......................................................................................................... 9
Apartment Class................................................................................................ 11
Administrator Class........................................................................................... 13
Process Class..................................................................................................... 14
Menu Class........................................................................................................ 28
Sample Outputs................................................................................................ 30
Assumption.............................................................................................................. 35
Conclusion............................................................................................................... 36
References............................................................................................................... 37

Fundamentals of Software Development

Page | 2

Group Assignment

UC1F1105 (IT)

Workload Matrix
Name
Yeoh Seng Joo
TP026131
Eng Hon Kheong

Percentage (%)

Signature

Programming / Documentation
70
30
30

70

TP 022981

Fundamentals of Software Development

Page | 3

Group Assignment

UC1F1105 (IT)

Flow chart

Fundamentals of Software Development

Page | 4

Group Assignment

Fundamentals of Software Development

UC1F1105 (IT)

Page | 5

Group Assignment

UC1F1105 (IT)

Abstract

This group assignment is mainly focus on students' knowledge in Java programming language
along with their software developing skill. This documentation explains the detail of our
program, which is done by following the assignment question. This is a very challenging
coding assignment as this is the first time that we doing this kind of assignment. This
documentation contains various requirements that are asked for in the assignment question
itself.

Fundamentals of Software Development

Page | 6

Group Assignment

UC1F1105 (IT)

Acknowledgement

We would like to give our highest gratitude to the each of the following person who has made
the completion of this FSD group assignment possible.
First of all, our appreciation goes off to our subject lecturer, Mr.Tan Kwong Hwee. He taught
us from zero programming skill to a rookie that knows how to code. He is a good mentor that
guided us from the beginning of semester until now. Without him, for sure that we wont even
able to create a single program.
The members would also like to offer gratitude to the group leader, Yeoh Seng Joo who had
done majority of the work.
In the end, I appreciate all the help and guidance that given by my cousin who is currently
studying in KTAR. Without his help we wont finish this program in time because my group
is lack of manpower and resources.

Fundamentals of Software Development

Page | 7

Group Assignment

UC1F1105 (IT)

Flowchart

Fundamentals of Software Development

Page | 8

Group Assignment

UC1F1105 (IT)

Source Code
Student Class
Student class needed to be created because the apartment program is built for student. Student
class is built with the name, identity card number, student id, apartment rented type, apartment
expired date and the rental balance for their apartment reservation.

Fig 1.1 Student Variables

Looking at the Fig 1.1, private String variables student Name, student ID, student Identity,
student Expiry and private double variable student Rental are declared.

Fig 1.2 Student Constructor

The above constructor is used to initialize a students information.

Fundamentals of Software Development

Page | 9

Group Assignment

UC1F1105 (IT)

Fig 1.3 Student get and set methods

There are get and set method used to allow other classes set the value of the variable.

Fundamentals of Software Development

P a g e | 10

Group Assignment

UC1F1105 (IT)

Apartment Class
Apartment Class is designed to keep information of the two apartments, Apartment A and
Apartment B. Information regarding these apartments includes the capacity of it, the
remaining rooms in it, and the rental charge.

Fig 2.1 Apartment Variables

Fig 2.1 shows Apartment class declared the private variables. The type A apartment and type
B apartment is set to final with maximum number room of 3. By declaring final of room
number because the room number cannot be increase and there is only 3 rooms per apartment
unit. The maximum capacities of the apartments are represented with the variables
max_TypeA and max_TypeB. The rental price of typeA_price is according to the price
staying at apartment A and the typeB_price is according to the price of the apartment B.
whereas the apartment B MasterRoom_price is refer to the master room price at apartment B.

Fig 2.2 Apartment get Methods for available rooms

The above figure 2.2 is the get method of the Apartment class is return the value of apartment
A or apartment B. If the user choose the value type A, then the reservation apartment will be
apartment A.

Fundamentals of Software Development

P a g e | 11

Group Assignment

UC1F1105 (IT)

Fig 2.3 Apartment get Methods for the maximum capacity of Apartments

The code shown in Fig 2.3 is another get method in the apartment class which is return the
value of the maximum number of the room. This method will help the user do not need
specific command to calling the method to obtain the value.

Fig 2.4 Apartment get Methods for the rental charges of


Apartments

The get method above is the charged the particular of the difference apartment and the rooms.
getTypeA_Price() is the price for rooms in Apartment A; getTypeB_Price() returns the price
for normal rooms in Apartment B whereas getTypeBMaster_Price() returns the price for the
master room in Apartment B. As mentioned in above figure, price only need to be done once
instead of obtain the price every time.

Administrator Class

Fundamentals of Software Development

P a g e | 12

Group Assignment

UC1F1105 (IT)

This program is use to do the student reservation, but this system only allow authorized
person to use it. Therefore, we consider the credential of the system and come out with an
administrator class.

Fig 3.1 Administrator Class

In above figure, the administrator password will be ask when someone try to do a search on
the system. This will protect the data from unauthorized used. A get method returns the string
PASSWORD when it have been called.

Fundamentals of Software Development

P a g e | 13

Group Assignment

UC1F1105 (IT)

Process Class
This Process class is the major and important class of all the class. This class consists of the
main method for the whole university Apartment system. The classes contain like registering
a student into the selected room and check out the student and the status updated, generating
the report of the availability of room and searching the student detail on the rental.

Fig 4.1 Importing Classes from other packages

The Process class imported the scanner, calendar and inputmismatchexception from the
java.util. Besides that, java.io also imported to allow receive the input from the user.
Importing those classes is from package is address the class by the class name itself instead of
the full patch name. scanner class is used to scan the user input, the calendar class is used to
get the current date and the time and inputmismatchexception is used to catch the user
mismatch and keep looping the system.

Fig 4.2 Variables of Module Class

Since these variables are declared outside of the methods in Module Class, every method will
have a copy of the variables instead of declaring a different variable in every method. This
will reduce the loading time and avoid unnecessary resources.

Fundamentals of Software Development

P a g e | 14

Group Assignment

UC1F1105 (IT)

Fig 4.3 Creating objects

Creating objects allows methods in it to be invoked.

Fig 4.4 Dynamic Initialization

In Fig 4.4, line 28 and line 36 creates an array of Student object, naming the array as
Student_A[] and Student_B[] with the size of 3 Student object in each array. The arrays of
objects are initialized using dynamic initialization to their default value.

Fundamentals of Software Development

P a g e | 15

Group Assignment

UC1F1105 (IT)

Fig 4.5 regMenu method part 1

In Fig 4.5, it

shown the user to choose the type of the apartment. The

inputmismatchexecption will catch up the user input error and request for reenter the integer.

Fundamentals of Software Development

P a g e | 16

Group Assignment

UC1F1105 (IT)

Fig 4.6 regMenu method part 2

This part is continued from the part 1, after the user make the choice of which type of
apartment need to be choose, the case 1 will initiated to check the availability of the room at
the apartment A and starting to input the new student information and prompt for student
name, ic, id and after that will give a bill statement state that how much the student need to be
pay.

Fundamentals of Software Development

P a g e | 17

Group Assignment

UC1F1105 (IT)

Fig 4.7 regMenu method part 3

Following up the switch function in Fig 4.6, the cases are executed based on the users input.
If the system have detected the full of the room, the user will prompt to choose the apartment
again,.

Fundamentals of Software Development

P a g e | 18

Group Assignment

UC1F1105 (IT)

Fig 4.8 register method part 1

Another method in the Module Class would be the method register. In Fig 4.8, it starting to
collect the information into the array s_A[countA] and the student detail goes into the student
array. First it prompt for student name, the following by student ic, and student id, and after
confirm the student will received the bill statement and the date start counting for 140days
from the current date. After that, the system will give the update of availability of room in the
selected apartment.

Fundamentals of Software Development

P a g e | 19

Group Assignment

UC1F1105 (IT)

Fig 4.9 register method part 2

Figure above is difference selected apartment. It is the apartment b with the master room.

Fundamentals of Software Development

P a g e | 20

Group Assignment

UC1F1105 (IT)

Fig 4.10 register method part 3

In this case, it is continuing of the register with difference room selection, this is the normal
room at the apartment b.

Fundamentals of Software Development

P a g e | 21

Group Assignment

UC1F1105 (IT)

Fig 4.11 checkOut method

The checkOut works same to the register method. This method allow the user checkout from
the apartment by enter their detail, student ID.

Fundamentals of Software Development

P a g e | 22

Group Assignment

UC1F1105 (IT)

Fig 4.12 search method part 1

The search method is implemented to search for the details of a student based on a students
ID. This search can only be accessed by administrator, so a password is set. The default
password for administrator will be admin; this can be change by changing the value of the
PASSWORD in the administrator class.

Fundamentals of Software Development

P a g e | 23

Group Assignment

UC1F1105 (IT)

Fig 4.13 search method part 2

After the password match, the search method will prompt for the student ID to search in the
array, after checked the valid of the student ID, it will comes out all the necessary detail like
student name, student IC, apartment type, monthly rental and the expiry date.

Fundamentals of Software Development

P a g e | 24

Group Assignment

Fundamentals of Software Development

UC1F1105 (IT)

P a g e | 25

Group Assignment

Fundamentals of Software Development

UC1F1105 (IT)

P a g e | 26

Group Assignment

UC1F1105 (IT)
Fig 4.27 reporting method

The status method is implemented to display the amount of available units in both apartments.
In this method, the user is choosing the type of the apartment and it will display whether the
room of the apartment available or not.

Fundamentals of Software Development

P a g e | 27

Group Assignment

UC1F1105 (IT)

Menu Class
The Menu class acts as the main menu of the apartment system, which directs the user to the
service they want.

Fundamentals of Software Development

P a g e | 28

Group Assignment

UC1F1105 (IT)

Fig 5.1 Menu class

This class is prompts the user to input their choice accordingly. The input will then be stored
in the Integer variable choice. A switch function is implemented with choice as the
parameter. Case 1 calls the register method ; Case 2 calls the method checkOut; Case 3 calls
the reporting method; Case 4 calls the search method; Case 5 is the termination of the
program.

Fundamentals of Software Development

P a g e | 29

Group Assignment

UC1F1105 (IT)

Sample Outputs

Fig 6.1 Sample Output of Register a new student

After the registering process in Fig 6.1, the user timothy will be assigned to room 1. Any
further application to the room 1 will be displayed with a message indicating that the room
has been taken.

Fundamentals of Software Development

P a g e | 30

Group Assignment

UC1F1105 (IT)

Fig 6.2 Sample Output of Register

After successfully booked, there is message display at the bottom state that the room has
successfully booked.

Fundamentals of Software Development

P a g e | 31

Group Assignment

UC1F1105 (IT)

Fig 6.3 Sample Output of Checkout

If the user wants to checkout from the apartment system, they will need to enter the details, id
number to verify.

Fundamentals of Software Development

P a g e | 32

Group Assignment

UC1F1105 (IT)

Fig 6.4 Sample Output of Apartment Status

Referring to Fig 6.4, there is master room in apartment B is taken, the display message will be
0 rooms.

Fundamentals of Software Development

P a g e | 33

Group Assignment

UC1F1105 (IT)

Fig 6.5 Sample Output of Search

This search feature can only access by the authorized person only. Therefore, when this
feature have been chosen, there will prompt a password and then continue with student
information, ID number.

Fundamentals of Software Development

P a g e | 34

Group Assignment

UC1F1105 (IT)

Assumption
There are 2 variables in the apartment class, max_capacityA and max_capacityB. These 2
variables control the maximum capacity of the apartment. When cases arise where the
apartment had an extension in terms of capacity, only these 2 variables requires changes, as
such providing ease in modification.
Possibility of enhancing the program by providing a special class for the administrator is
there. When it grows larger, the administrator could be provided with more authority or
special functions that only they will be able to get access to. As such, by providing their
special class, we are also able to provide ease in modification like how we have done with the
apartment capacity problem, thus enhancing the user-friendliness of the program.

Fundamentals of Software Development

P a g e | 35

Group Assignment

UC1F1105 (IT)

Conclusion
JAVA programming is a challenged chapter of study. After a long time try and error,
maximizing the possibility of the programming, our group finally creating a fundamental
running program for real world application. We are glad that we already learnt programing
and later on can develop a useful tool for a part of the world.

Fundamentals of Software Development

P a g e | 36

Group Assignment

UC1F1105 (IT)

References
P.J Deitel, H.M Deitel,2007 Java How to Program Seventh Edition. United Kingdom:
Pearson Education.

Y. Daniel Liang,2010 Introduction to Java, Comprehensive Version Eight Edition. United


Kingdom: Pearson Education.

Harvey Deitel,Paul Deitel, 2009 Java: How to Program Eight Edition. United Kingdom:
Pearson Education.

Rose India Technology Pvt.Ltd, 2009 Calender Example [online]


Available at: <http://www.roseindia.net/java/beginners/CalendarExample.shtml>

Internet Related Technology org, 1997, Array, Object Arrays and Sorting [online]
Available at: <http://www.irt.org/articles/js054/>

Fundamentals of Software Development

P a g e | 37

You might also like