You are on page 1of 28

1820127

1
1820127

Table of Contents
Cover Page .......................................................................................................................................................... 1
Table of Contents ............................................................................................................................................... 2
Figures ................................................................................................................................................................ 3
Introduction........................................................................................................................................................ 4
Model of the program ......................................................................................................................................... 5

 Use Case Diagram .............................................................................................................................. 5


 Class Diagram .................................................................................................................................... 7

Implementation .................................................................................................................................................. 8

 Main Class ............................................................................................................................................. 8


 Main Menu ............................................................................................................................. 9
 Airplane Details ........................................................................................................................ 9
 Flight Details .......................................................................................................................... 10

 Staff Details............................................................................................................................ 10
 Pilot Details ............................................................................................................................ 11
 Cabin Crew Details ................................................................................................................. 11
 Check the Information ........................................................................................................... 12
 Flight Details Class ............................................................................................................................... 13

 constructor ............................................................................................................................ 13
 Flight Details Output ............................................................................................................. 14
 Getter and Setter ................................................................................................................... 14
 Airplane Details Class........................................................................................................................... 15

 constructor ............................................................................................................................ 15
 Airplane Details Output ......................................................................................................... 16
 Getter and Setter ................................................................................................................... 17
 Staff Details Class ................................................................................................................................ 17

 constructor ............................................................................................................................ 17
 Staff Details Output ............................................................................................................... 18
 Pilot & Cabin Crew Details Classes ....................................................................................................... 18
 Pilot Details Output ................................................................................................................ 19
 Cabin Crew Details Output..................................................................................................... 19

Conclusion ........................................................................................................................................................ 20

References ........................................................................................................................................................ 21

2
1820127

Figures Table

Figure 1: use case diagram ............................................................................................................................................2


Figure 2: class diagram ..................................................................................................................................................2
Figure 3: algorithm ........................................................................................................................................................2
Figure 4: main menu ......................................................................................................................................................2
Figure 5: main menu ......................................................................................................................................................2
Figure 6: main menu ......................................................................................................................................................2
Figure 7: main menu codes ............................................................................................................................................2
Figure 8: airplane option codes .....................................................................................................................................2
Figure 9: airplane option ...............................................................................................................................................2
Figure 10: flight option ..................................................................................................................................................2
Figure 11: flight option codes ........................................................................................................................................2
Figure 12: staff option ...................................................................................................................................................2
Figure 13: staff option codes .........................................................................................................................................2
Figure 14: pilot option ...................................................................................................................................................2
Figure 15: pilot option codes .........................................................................................................................................2
Figure 16: cabin crew option .........................................................................................................................................2
Figure 17: cabin crew option codes ...............................................................................................................................2
Figure 18: Check the Information option .......................................................................................................................2
Figure 19: Check The Information option codes ............................................................................................................2
Figure 20: flight details class codes ...............................................................................................................................2
Figure 21: constructor codes..........................................................................................................................................2
Figure 22: flight details output ......................................................................................................................................2
Figure 23: flight details output codes ............................................................................................................................2
Figure 24: getter & setter codes ....................................................................................................................................2
Figure 25: airplane class codes ......................................................................................................................................2
Figure 26: constructor codes..........................................................................................................................................2
Figure 27: airplane details output .................................................................................................................................2
Figure 28: airplane details output codes .......................................................................................................................2
Figure 29: getter & setter codes ....................................................................................................................................2
Figure 30: staff details codes .........................................................................................................................................2
Figure 31: constructor codes..........................................................................................................................................2
Figure 32: staff details output codes .............................................................................................................................2
Figure 33: staff details output .......................................................................................................................................2
Figure 34: pilot details class codes.................................................................................................................................2
Figure 35: cabin crew details class codes ......................................................................................................................2
Figure 36: pilot details output .......................................................................................................................................2
Figure 37: pilot details output codes .............................................................................................................................2
Figure 38: cabin crew details output .............................................................................................................................2
Figure 39: cabin crew details output codes ...................................................................................................................2

3
1820127

Introduction
In the advancing world of knowledge, the applications are a rapidly rising segment of the global
user of this applications. Mobile applications and others programs are growing at a meteor
pace to give users a rich and fast user experience. Java is a software design language primary
released by Sun Microsystems back in 1995. It can be found on many different kinds of devices
from smart-phones, to PC computers (Bose, S., Mukherjee, M., Kundu, A. and Banerjee, M., 2018).
In this task I created an application, the program created for flight schedule system is the most
important part of an airline's planning process. I developed the flight schedule system using
java programing developer. As all of us know like this applications is best ways for airline's
resources to fulfil demand and optimize earnings.
However I wrote this java program, which describes the inheritance hierarchy of these flight
schedule system with the required classes using detailed in the rest part of this case study. The
program was with some input/output. The main information this programmer has are:
 Airplane Details, which includes:
 The type of plane
 The model number of plane
 The seating capacity of the plane
 The name of pilot assigned for each aircraft
 The Availability of the seating

 Flight Details, which includes:


 The Departure Place
 The Destination
 Departure time
 Arrival time
 Date of flight
 Aircraft assigned

 Staff Details, which includes:


 Name of staff
 Staff id
 Address
 Designation
 Email
 Salary

 Pilot and the Cabin Crew:


 This input inherits all the properties of a staff.

4
1820127

Model of the program


In this part of this report will cover UML diagrams in the above scenario and show your analysis
of the requirements. In other hand will cover some professional and ethical approaches which
you have considered when you design your System.
UML is a tools that means Unified Modeling Language. Basically, UML is a recent method to
displaying and documenting software. Actually, it is one of the best popular commercial
progression modeling methods. It is built on graphic symbols of software components. As the
old proverb says: “a picture is worth a thousand words”. Via using visual symbols, we are able
to better recognize possible flaws or errors in software or commercial processes (Tallyfy, 2018)..

Use Case Diagram


A significant point of the Unified Modeling Language (UML) is the abilities to draw use case
diagrams. Use-cases are used through the study points of a task to identify and partition system
functionality. They separate the program into actors and use-cases. Actors symbolize parts that
can are played via operators of the program. Use-cases symbolizes for the actions that actors
do with the assistance of the system in the pursuit of an aim. The requirement to define what
this operator (actor) needs from the program. Use-case reflecting the operator needs and goals
(Point, T., n.d).

5
1820127

Figure 1: use case diagram

This use case created for flight schedule system for an airline company with the required
classes detailed. There are four actors in the use case which they can use this system. First actor
is pilot, the main things the pilot can do in this system just fly the airplane and get salary.
Second actor in this system the show the cabin crew responsibly which will be give instruction,
check security, serve food for the pilots and the passengers and get salary. Third actor is admin,
the admin can access the system to manage passenger data, manage ticker availability, add or
edit staff details and update the flight schedules. The last actor in this system is passenger
which he/she can check for availability for the seats or tickets also can view the ticket then
choose the seat and finish the booking. However login function with passenger that not
available in this system but in next update of the system it will be available (Point, T).

6
1820127

Class Diagram

Figure 2: class diagram

A Class in UML diagram may be an outline utilized to make an object or set of objects. The Class
defines what an object can do. It could be a layout to make different objects
and implement their behavior within the program. A Class in UML is symbolized by a rectangle
that includes rows with class names, attributes, and operations (Alyssa Walker 2021). This class
diagram made to help out in this program. First of all it helps to explain the kinds of objects in
the system and the different kinds of relations that exist between the objects. However in this
class diagram there are many relationship among the classes. Starting with flight details class
which has relationship with airplane details class and staff details class. That relationship is all
about the necessary information for the flight. Taking about the relationship among flight

7
1820127

details class and airplane details class first the aircraft information must be present for the
flight. Second with staff details class, the pilot and cabin crew are a staff so that means there
are a part of staff details class. Likewise the flight needs a pilot and cabin crew. As we sow the
relations between the class so important. However the class diagram improved for
understanding of overall plans of program.

Implementation

Enter your ID and Password

8
1820127

The code of Login page

String connection URL

This for string for save this word and will use it in next step.

connectionURL = "jdbc:derby://localhost:1527/ALMO";

code for connection to database

9
1820127

Connection conn = DriverManager.getConnection(connectionURL, "A","A");

Code for connection to the database and cheek for username and password

rs=st.executeQuery("Select * from A.LOGIN where ID="+ this.txt1.getText() +" and PASS='"+


this.txt2.getText() +"'");

in this SQL commend we call the table from the databases to get the data.

st.executeQuery is Returns one Result Set object.

ResultSet rs;

Here we call this class of Result Set and save in Rs;

Statement st = conn.createStatement();

creates a Statement object to be used for sending SQL commands to the database.

When you press in Enter if the ID and Password is correct you will move to next page.

Second page is welcome page.

Small window showing welcome, with menu bar.

10
1820127

From file you can chose add item and move to next page to add a new item.

Code of move to next page.

setVisible(true) is a blocking operation and blocks until dialog is closed.

11
1820127

The main page for the program you can see many buttons and text filed

For the text filed we have 4 texts filed

One for item number, second for item description, third for item price, fourth for item stock

And we have 5 of button get, clear, add, edit, delete.

Java software package using information structures to stock and launch information, and Use
algorithms to control the data in those structures. In this part Figure 3: algorithm of this

12
1820127

report I will talk about about some functions with implementation that I used to make this
program.

1. Main Class

In this part of this report going to explain about the code and placing screenshots of the
running program roles, using a short explanation. First of all will start with the Main class.

Figure 4: main menu

Figure 5: main menu

In this section of the main class we called the other class. Starting with Airplane class, it called
to the main by using extends function. Then calling the other classes by declaring the classes in
the main class as it showing in above.
1.1 Main Menu

Figure 6: main menu Figure 7: main menu codes

This is the main menu of flight schedule application. This application will consume a seven
selections for user to access the functionalities of the arrangement. However we be able to

13
1820127

realize in the screenshots of the running application above the main menu has the next
selections:

1. Airplane Details.
2. Flight Details
3. Staff Details
4. Pilot Details
5. Cabin Crew Details
6. Exit.

1.2 Airplane Details

Figure 9: airplane option Figure 8: airplane option codes

In this first choice in flight schedule program. It allows the user to enter or input all data about
aircraft that will be use in the specific flight as it shown in figure 7. In figure 8 the codes that
used in this choice and located in main class.

1.3 Flight Details

Figure 10: flight option Figure 11: flight option codes

14
1820127

The next choice of the main menu lets the users to add the flight details such as departure,
destination, departure time, arrival time and date of the flight. All this information will be
shown for the pilot and cabin crew five days before the flight. Also program gives access for the
passengers to check all information about the flight.

1.4 Staff Details

Figure 12: staff option Figure 13: staff option codes

In the third option of main menu allowing the user to input the data about the staff. The admin of this
program only has the access to add staff information. The admin should fill all require information about
the staff for example the name of staff, ID number, address, designation, email and salary.

1.5 Pilot Details

Figure 14: pilot option Figure 15: pilot option codes

15
1820127

Pilot details option created to add the all information of the pilot for the flight. This option lets
the admin to input the pilot data. As we can see in figure 13 there is the requirement
information the admin should input and this information are (first name, last name, ID number,
address, email, salary and date of joined).

1.6 Cabin Crew Details

Figure 16: cabin crew option Figure 17: cabin crew option codes

In the fifth option of this program will let the admin only to input the cabin crew information as
with pilot details option. As we can notes almost same information between the pilot and cabin
crew. However, the cabin crew is a part of the staff but the option created because there are
some important information must be fill like first name and last name, all that because of the
cabin crew and the pilot flight from country to other and full information should presented to
the other airport.

1.7 Check the Information

16
1820127

Figure 18: Check the Information option

In this choice of the main menu will allow the user


the check all the data entered in this program. After
going to this option the output menu will be showing
for the user. There many details can the use check
for example:
1-All information.
2-Airplane information.
3-Flight information.
3-Staff information.
5-Pilot information.
6-Cabin Crew information.

Figure 19: Check The Information option codes

Also the last option of this menu will let the user to go back to the main meu. However, this
menu created by using if-else if statement to control the options in the menu as it showing in
figure 18.

2. Flight Details Class

17
1820127

Flight details class is the second class created in this program. Which is Designed and
implemented to store data about a commercial flight. The data includes the next variable as
it showing in figure 19:

Origin.
Destination.
Departure time.
Arrival time.
Date of flight.

Figure 20: flight details class codes

2.1 constructor
In this part of flight details class used a
constructor which accepts some data of the
data of this class such as origin, destination
and date of flight. We used constructor with
argument for variable as "String". Also used
constructor without argument the main
purpose of using this to return the values Figure 21: constructor codes
from the main class in order.

2.2 Flight Details Output

18
1820127

Figure 22: flight details output Figure 23: flight details output codes

In this section of the flight class the most important codes figure 21 that will let the user to see
the output of flight details figure 20. By using constructor methods to return the values from
main class to this class.

2.3 Getter and Setter

Figure 24: getter & setter codes

Figure 22 showing the getter and setter codes which will let to control over the values. The
getter method used to return the value of the element. The setter method taking the value and
assigns it to the element.

19
1820127

3. Airplane Details Class

Airplane details class is the third class that created for flight schedule system program. However
this class is made to store information about the aircraft. The information that must be fill by
the admin as it will cover in next points:

• Make.
• Model.
• Capacity.
• Pilot.
• Available.

Figure 25: airplane class codes

First value in this class will be string which will be for the type of the model of aircraft. The
second and third values will be mode and capacity and they goanna be integer that will let the
user to enter numbers only. Fourth value in airplane details will allow the user to enter the
name of the pilot of the flight. Last value of this class for availability of the seats of the flight.

3.1 constructor

Figure 26: constructor codes

In this part of airplane details class declared a constructor which accepts the information of this
class. We used constructor with argument for variable as "String, Int and Boolean". Also used
constructor without argument the main purpose of using this to return the values from the
main class in order.

20
1820127

3.2 Airplane Details Output

Figure 27: airplane details output Figure 28: airplane details output codes

As all can see this is the output of the airplane details class figure 25. Via using codes in figure
26 all data that entered in main class printed out

3.3 Getter and Setter


Figure 27 display the getter and setter codes
which will let to control over the values. The
getter method used to return the value of
the attribute. The setter method taking the
value and assigns it to the attribute.

Figure 29: getter & setter codes

21
1820127

4. Staff Details Class


This class of the flight schedule system program allows the user to show the staff information.
This class created to show the next information of the staff:

• Name.
• Staff ID.
• Address.
• Designation.
• Email.
• Salary.

Figure 30: staff details codes

As it showing in figure 28 there are string and integer objects. Thee string object used for name,
address, designation, email and salary. In other hand integer object used for staff id number
only because the id number must be numbers without letters.

4.1 constructor

Figure 31: constructor codes

Constructor used in this class to return the values from main class as mentioned. We used
constructor with argument for variable as "String and Integer". Likewise used constructor
without argument the main purpose of using this to return the values from the main class in
order.

22
1820127

4.2 Staff Details Output

Figure 33: staff details output Figure 32: staff details output codes

This part of the codes in staff details of the program will print out the full information of the
staff as is shown in figure 30. The information most information that will be shown are the
name of the staff, ID number of the staff, the address of the staff, designation, email and salary.

5. Pilot and Cabin Crew classes

Figure 34: pilot details class codes Figure 35: cabin crew details class codes

The figures 32 and 33 created for pilot details class and cabin crew details class. Both of this
classes extended of staff details class. The most important information must be fill in this two
classes are first name, last name, ID, address, email, salary and date of joined.

23
1820127

5.1 Pilot details Output

Figure 36: pilot details output Figure 37: pilot details output codes

Figure 35 is made for pilot details output part in this program. Likewise we can see in figure 34
the clear screenshot of the output with full information of the pilot.

5.2 Cabin Crew Details Output

Figure 38: cabin crew details output Figure 39: cabin crew details output codes

Figure 36 is showing the output for cabin crew details by using codes in figure 37. The
information must be fill through the admin. The admin must be know the first name, last name,
ID number, address, designation, email, salary, date of joined and the description of job of the
cabin crew.
1. Testing :

24
1820127

page : Expected Result: Actual Result Pass/ Fail

Loging page When login with a PASS


correct ID and
Password .

Loging page When login with a PASS


wrong ID and
Password .

Main page When add a PASS


Add : correct value

Main page When add un PASS


Add : correct value

Main page: When update a PASS


Update : correct value

Main page: When updtae un PASS


Update : correct value

25
1820127

Main page: When add a PASS


Deleted : correct value

Main page: When add un PASS


Deleted : correct value

Main page: When you put un PASS


GET : correct item
number

Conclusion

In the end of this report will be dissertation about what I have knowledgeable from how
different OOP and from making the flight schedule system programs in this assignments. OOP
concepts in Java are the key in the Java’s Object Oriented Programming. They are an
abstraction, encapsulation, inheritance and polymorphism. In this program inheritance been
used. Inheritance is a special feature of OOP in Java. It lets program writer to build a new
classes that share a lot of the attributes of different classes ( ALTVATER, A., 2017). It was kindly hard to
know the all concepts about the program. On the other hand after learning Java in the classes
in this semester it converts to easy to understand in what method to deal with it.

26
1820127

References

Tallyfy. 2018. All You Need to Know About UML Diagrams: Types and 5+ Examples. [online] Available at:
<https://tallyfy.com/uml-diagram/> [Accessed 13 October 2021].

Bose, S., Mukherjee, M., Kundu, A. and Banerjee, M., 2018. A comparative study: java vs kotlin
programming in android application development. International Journal of Advanced Research in
Computer Science, 9(3), p.41.

Point, T., n.d. Use-Case Diagrams. [online] Tutorialspoint.com. Available at:


<https://www.tutorialspoint.com/business_analysis/business_analysis_usecase_diagrams.htm>
[Accessed 20 October 2021].

27
1820127

ALTVATER, A., 2017. What Are OOP Concepts in Java? The Four Main OOP Concepts in Java, How They
Work, Examples, and More. [online] Stackify. Available at: <https://stackify.com/oops-concepts-in-java/>
[Accessed 2 November 2021].

Walker, A., 2021. UML Class Diagram Tutorial: Abstract Class with Examples. [online] Guru99. Available
at: <https://www.guru99.com/uml-class-diagram.html> [Accessed 3 November 2021].

28

You might also like