You are on page 1of 72

Airline Reservation system

Introduction

Air transport industry is an area of commerce in which aircraft are employed to carry
passengers, freight and mail etc. Air transport companies operate scheduled flights and non-
scheduled services over local, regional, national and international routes.
Manually, it is very laborious and slow as well, to generate the seat assignments,
flight scheduling, and aircraft loading hence an automation system of interaction with
airlines reservation is necessitated. Airlines reservation system originated in the mid-1950s
as relatively unsophisticated internal system to help with tasks (as above said).
Airlines reservation basically includes issuing tickets to passengers who want to fly to
a particular destination a particular day and time.
Thus, the various activities that the airlines reservation encounter are checking the
plane that flies to a particular from a starting point, checking the availability of seats in that
particular flight and to issue the tickets if the seat is available. Then there is problem of
cancellation. If a passenger for some reason wants to cancel a confirmed ticket, then the
penalty is calculated based on the time the cancellation is made and the balance amount is
refunded. The amount to be refunded is based upon the airlines’ cancellation policy.
ABSTRACT:

"Airline Reservation System " is an attempt to simulate the basic concepts of an


online Reservation system. The system enables to perform the following functions:

 To give a detailed list of available flights

 To give the number of seats in the particular available flight (i.e. it gives the status of
the flight)
 Booking of a ticket

 Cancellation of an existing reservation

 To store and retrieve passenger’s information


NEED FOR THE SYSTEM:

Before the automation, the system suffered from the following drawbacks:
 The existing system is highly manual involving a lot of paper work and calculation
and therefore may be erroneous. This has lead to inconsistency and inaccuracy in the
maintenance of data.
 The data, which is stored on the paper only, may be lost, stolen or destroyed due to
natural calamity like fire and water.
 The existing system is sluggish and consumes a lot of time causing inconvenience to
customers and the airlines staff.
 Due to manual nature, it is difficult to update, delete, add or view the data.
 Since the number of passengers have drastically increased therefore maintaining and
retrieving detailed record of passenger is extremely difficult.
 An airline has many offices around the world, an absence of a link between these
offices lead to lack of coordination and communication.
SYSTEM ANALYSIS

The goal of analysis is to first understand the domain of the problem and the
system's responsibilities by understanding how the users use or will use the system. System
Analysis phase mainly deals with finding out what is needed rather than how it is going to be
built.
Existing System
 The Existing System Provides a lengthy way to reserve a ticket in airlines.
 Fast & Quick way is not provided
 Time Consuming
 Every time we need to login and check mail in the web browser
 Storage of mail in local disk is not present.

Proposed System
Hence the airline reservation system is proposed with the following
PRODUCTION PERSPECTIVE:

 The computerization of the reservation system will reduce a lot of paperwork and
hence the load on the airline administrative staff.

 The machine performs all calculations. Hence chances of error are nil.

 The passenger, reservation, cancellation list can easily be retrieved and any
required addition, deletion or updation can be performed.

 The system provides for user-ID validation, hence unauthorized access is


prevented.
Users with varying levels of familiarity with computers will mostly use this system.
With this in mind, an important feature of this software is that it be relatively simple to use.
The scope of this project encompasses: -

Flight Information:
The function allows the airline passenger to search for flights that are available
between the two types, namely the "Domestic flights" and "International Flights". In the
"Reservations" function, the system initially prompts the passenger for the two types and
displays a list of airline flights that are scheduled for these types..
• When the passenger chooses for the information about the flight, flight details
are shown as: Flight Number, Flight Fare and the total number of available
seats in the flight.
• On Cancellation of a Ticket or Reservation, the total booked seats are
decremented and are reflected in the flights details.

After the system displays a list of available flights, the passenger is allowed to choose a
particular flight and make reservations for that flight.

Flight Status:
When the passenger chooses a flight, he books the ticket to perform Flight
Reservation. The details for the selected flight are queried from the ‘flights’ database. The
flight details shown are: Flight number, Flight Fare, Departure City, Departure date (day of
current month), Departure Time, Arrival City, Arrival date and Arrival time, number of seats
available in a particular flight on a particular day.

Passenger Info: This module consists of the details of passenger’s booking for a flight. The
personal details it consists are like Name, Age, Sex, Address, Email id and Contact Phone
number.
Booking/Reservation: This module consists of the entries made at the reception by the
operator for the advanced ticket booking of a passenger. It contains Passenger No., Class,
Fare, Ticket, Date of Journey, Date of Booking, Discount, and Total Fare.

Cancellation of existing Flight Reservation : The system also allows the passenger to
cancel an existing reservation. This function registers the information regarding a passenger
who has requested for a cancellation of his/her ticket. It includes entries pertaining to the
Flight No., Ticket No, Name, Source, Destination, Date of Journey, Fare deducted.
SYSTEM ANALYSIS

REQUIREMENT ANALYSIS

Introduction
Requirement specification plays a key role in the software development process.
It is used to gather information needed to give an insight into the product, its functionality,
its design and its implementation procedure. Requirement Specification should be

 Clear
 Unambiguous
 Understandable
 Consistent
 Complete

Numerous studies have repeatedly shown that the majority of defects have
their root cause in problems with requirement specification. In one study quoted by James
Martin, over 50% of all software defects are caused by incomplete, incorrect inaccurate
and/or ambiguous requirement and over 80% of the costs of defects have their roots in
requirements based errors. Another study established that a defect found in product in 270
times more expensive to fix than the error found at the requirements stage of the project. The
major opportunity for improving the way the software systems are tested lies in improving
the process in which requirements specification are developed and functional tests are
designed.
Requirement analysis puts the product in perspective, with other existing product and
reviews, the infrastructure and resources needed for developing the product including the
required technical skills of the developing team and of the end users. Its purpose is two fold:

 It can be analyzed and confirmed by the customer in order to verify whether it has
captured all of the customer’s expectations.
 The software engineer can use this to develop a solution that meets the
requirements.

The goal of analysis is to first understand the domain of the problem and the
system's responsibilities by understanding how the users use or will use the system. System
Analysis phase mainly deals with finding out what is needed rather than how it is going to be
built.

User-Interface Requirements

• The interface that the user is given to work on the application should be easy to use by
anybody with very little guidance.

• This is very important from the user point of view because the people who are designated
to use the system are not highly qualified as far as computers are concerned.

• As a result the user interface should be as user friendly as possible, within the limits of
efficiency.

• All are shown graphically that everyone can understand

• Internal help for each & every command are provided.


SYSTEM STUDY

The requirement analysis phase is a process of discovery ,refinement , modeling


and specification of the tasks to be performed during any software development process.
The details of the system study are explained in this chapter . The background information
about the need for the project and the scope of the proposed system is also elaborated.

OVERVIEW

Functional requirements specify which output should be produced from the given
inputs. They describe the relationship between the input and output of the system. For each
functional requirement, a detailed description of all the data inputs and their source, the units
of measure, and the range of valid inputs must be specified. All the operations to be
performed on the input data to obtain the output should be specified. This includes
specifying the validity check on the input and output data, parameters affected by the
operations, and equation or other logical operations that must be used to transform the inputs
to corresponding output. For instance if there is a formula for computing the output, it should
be specified.
An important part of the specification is the system behavior in abnormal situations,
like invalid input (which can occur in many ways) or error during computation. The
functional requirement must clearly state what the system should do if such situations occur.
Specifically, it should specify the behavior of the system for invalid inputs and invalid
outputs. Furthermore, behavior for situation where the input is valid but the normal operation
can not be performed should also be specified. An example of this situation is AN
AIRLINE RESERVATION SYSTEM, where a reservation can not be made even for valid
passengers if the airplane is fully booked.
DEVELOPMENT ENVIRONMENT

Hardware Requirements

 Processor Type - Pentium IV


 RAM Size - 128MB
 Hard Disk Capacity - 20GB
 Clock Speed - 266MB

Software Requirements

 J2SDK 1.4

 Back end - System developed Data File

 Any Operating System which runs on Java Platform


About the Software
About Operating System

Windows XP is a line of operating systems developed by Microsoft for use on general-purpose


computer systems, including home and business desktops, notebook computers, and media centers.
The name "XP" stands for eXPerience.[2] It was codenamed "Whistler", after Whistler, British
Columbia, as many Microsoft employees skied at the Whistler-Blackcomb ski resort during its
development[citation needed]
. Windows XP is the successor to both Windows 2000 Professional and
Windows Me, and is the first consumer-oriented operating system produced by Microsoft to be built
on the Windows NT kernel (version 5.1) and architecture. Windows XP was first released on
October 25, 2001, and over 400 million copies were in use in January 2006, according to an estimate
in that month by an IDC analyst.[3] It is succeeded by Windows Vista, which was released to volume
license customers on November 8, 2006, and worldwide to the general public on January 30, 2007.

The most common editions of the operating system are Windows XP Home Edition, which is
targeted at home users, and Windows XP Professional, which has additional features such as support
for Windows Server domains and two physical processors, and is targeted at power users and
business clients. Windows XP Media Center Edition has additional multimedia features enhancing
the ability to record and watch TV shows, view DVD movies, and listen to music. Windows XP
Tablet PC Edition is designed to run the ink-aware Tablet PC platform. Two separate 64-bit versions
of Windows XP were also released, Windows XP 64-bit Edition for IA-64 (Itanium) processors and
Windows XP Professional x64 Edition for x86-64.

Windows XP is known for its improved stability and efficiency over the 9x versions of Microsoft
Windows. It presents a significantly redesigned graphical user interface, a change Microsoft
promoted as more user-friendly than previous versions of Windows. New software management
capabilities were introduced to avoid the "DLL hell" that plagued older consumer-oriented 9x
versions of Windows. It is also the first version of Windows to use product activation to combat
software piracy, a restriction that did not sit well with some users and privacy advocates. Windows
XP has also been criticized by some users for security vulnerabilities, tight integration of
applications such as Internet Explorer 6 and Windows Media Player, and for aspects of its default
user interface. Later versions with Service Pack 2, and Internet Explorer 7 addressed some of these
concerns.

New and updated features

Windows XP introduced several new features to the Windows line, including:

• Faster start-up and hibernation sequences


• The ability to discard a newer device driver in favour of the previous one (known as driver
rollback), should a driver upgrade not produce desirable results
• A new, arguably more user-friendly interface, including the framework for developing
themes for the desktop environment
• Fast user switching, which allows a user to save the current state and open applications of
their desktop and allow another user to log on without losing that information
• The ClearType font rendering mechanism, which is designed to improve text readability on
Liquid Crystal Display (LCD) and similar monitors
• Remote Desktop functionality, which allows users to connect to a computer running
Windows XP from across a network or the Internet and access their applications, files,
printers, and devices

User interface

Windows XP features a new task-based graphical user interface. The Start menu and search
capability were redesigned and many visual effects were added, including:

• A translucent blue selection rectangle in Explorer


• Drop shadows for icon labels on the desktop
• Task-based sidebars in Explorer windows ("common tasks")
• The ability to group the taskbar buttons of the windows of one application into one button
• The ability to lock the taskbar and other toolbars to prevent accidental changes
• The highlighting of recently added programs on the Start menu
• Shadows under menus (Windows 2000 had shadows under mouse pointers, but not menus)
Windows XP analyses the performance impact of visual effects and uses this to determine whether
to enable them, so as to prevent the new functionality from consuming excessive additional
processing overhead. Users can further customize these settings.[15] Some effects, such as alpha
blending (transparency and fading), are handled entirely by many newer video cards. However, if the
video card is not capable of hardware alpha blending, performance can be substantially hurt and
Microsoft recommends the feature should be turned off manually.[16] Windows XP adds the ability
for Windows to use "Visual Styles" to change the user interface. However, visual styles must be
cryptographically signed by Microsoft to run. Luna is the name of the new visual style that ships
with Windows XP, and is enabled by default for machines with more than 64 MiB of video RAM.
Luna refers only to one particular visual style, not to all of the new user interface features of
Windows XP as a whole. Some users "patch" the uxtheme.dll file that restricts the ability to use
visual styles, created by the general public or the user, on Windows XP.

In addition to the included XP themes, there is one previously unreleased XP theme with a black
taskbar and window bars similar to Windows Vista titled "Royale Noir" available for download,
albeit unofficially[17]. Microsoft officially released a modified version of this theme as the "Zune"
theme; the only difference being the color of the start button (from black to orange). Additionally,
the Media Center "Royale" theme is also available for download on non-Media Center PCs[19].

The default wallpaper, Bliss, is a BMP photograph of a landscape in the Napa Valley outside Napa,
California[20], with rolling green hills and a blue sky with stratocumulus and cirrus clouds.

The Windows 2000 "classic" interface can be used instead if preferred. Several third party utilities
exist that provide hundreds of different visual styles. In addition, another Microsoft-created theme,
called "Royale", was included with Windows XP Media Center Edition, and was also released for
other versions of Windows XP.

Java (programming language)

Java is a programming language originally developed by Sun Microsystems and released in 1995 as
a core component of Sun's Java platform. The language derives much of its syntax from C and C++
but has a simpler object model and fewer low-level facilities. Java applications are typically
compiled to bytecode which can run on any Java virtual machine (JVM) regardless of computer
architecture.

The original and reference implementation Java compilers, virtual machines, and class libraries were
developed by Sun from 1995. As of May 2007, in compliance with the specifications of the Java
Community Process, Sun made available most of their Java technologies as free software under the
GNU General Public License. Others have also developed alternative implementations of these Sun
technologies, such as the GNU Compiler for Java and GNU Classpath.

History

The Java language was created by James Gosling in June 1991 for use in a set top box project. [4] The
language was initially called Oak, after an oak tree that stood outside Gosling's office - and also went
by the name Green - and ended up later being renamed to Java, from a list of random words.[5]
Gosling's goals were to implement a virtual machine and a language that had a familiar C/C++ style
of notation.[6] The first public implementation was Java 1.0 in 1995. It promised "Write Once, Run
Anywhere" (WORA), providing no-cost runtimes on popular platforms. It was fairly secure and its
security was configurable, allowing network and file access to be restricted. Major web browsers
soon incorporated the ability to run secure Java applets within web pages. Java quickly became
popular. With the advent of Java 2, new versions had multiple configurations built for different
types of platforms. For example, J2EE was for enterprise applications and the greatly stripped down
version J2ME was for mobile applications. J2SE was the designation for the Standard Edition. In
2006, for marketing purposes, new J2 versions were renamed Java EE, Java ME, and Java SE,
respectively.

In 1997, Sun Microsystems approached the ISO/IEC JTC1 standards body and later the Ecma
International to formalize Java, but it soon withdrew from the process. [7][8][9] Java remains a de facto
standard that is controlled through the Java Community Process.[10] At one time, Sun made most of
its Java implementations available without charge although they were proprietary software. Sun's
revenue from Java was generated by the selling of licenses for specialized products such as the Java
Enterprise System. Sun distinguishes between its Software Development Kit (SDK) and Runtime
Environment (JRE) which is a subset of the SDK, the primary distinction being that in the JRE, the
compiler, utility programs, and many necessary header files are not present.

Philosophy
Primary goals

There were five primary goals in the creation of the Java language

It should use the object-oriented programming methodology.

1. It should allow the same program to be executed on multiple operating systems.


2. It should contain built-in support for using computer networks.
3. It should be designed to execute code from remote sources securely.
4. It should be easy to use by selecting what were considered the good parts of other object-
oriented languages.

Platform independence

One characteristic, platform independence, means that programs written in the Java language must
run similarly on any supported hardware/operating-system platform. One should be able to write a
program once, compile it once, and run it anywhere.

This is achieved by most Java compilers by compiling the Java language code halfway (to Java
bytecode) – simplified machine instructions specific to the Java platform. The code is then run on a
virtual machine (VM), a program written in native code on the host hardware that interprets and
executes generic Java bytecode. (In some JVM versions, bytecode can also be compiled to native
code, either before or during program execution, resulting in faster execution.) Further, standardized
libraries are provided to allow access to features of the host machines (such as graphics, threading
and networking) in unified ways. Note that, although there is an explicit compiling stage, at some
point, the Java bytecode is interpreted or converted to native machine code by the JIT compiler.

The first implementations of the language used an interpreted virtual machine to achieve portability.
These implementations produced programs that ran more slowly than programs compiled to native
executables, for instance written in C or C++, so the language suffered a reputation for poor
performance. More recent JVM implementations produce programs that run significantly faster than
before, using multiple techniques.

One technique, known as just-in-time compilation (JIT), translates the Java bytecode into native
code at the time that the program is run, which results in a program that executes faster than
interpreted code but also incurs compilation overhead during execution. More sophisticated VMs use
dynamic recompilation, in which the VM can analyze the behavior of the running program and
selectively recompile and optimize critical parts of the program. Dynamic recompilation can achieve
optimizations superior to static compilation because the dynamic compiler can base optimizations on
knowledge about the runtime environment and the set of loaded classes, and can identify the hot
spots (parts of the program, often inner loops, that take up the most execution time). JIT compilation
and dynamic recompilation allow Java programs to take advantage of the speed of native code
without losing portability.

Another technique, commonly known as static compilation, is to compile directly into native code
like a more traditional compiler. Static Java compilers, such as GCJ, translate the Java language code
to native object code, removing the intermediate bytecode stage. This achieves good performance
compared to interpretation, but at the expense of portability; the output of these compilers can only
be run on a single architecture. Some see avoiding the VM in this manner as defeating the point of
developing in Java; however it can be useful to provide both a generic bytecode version, as well as
an optimised native code version of an application.

Implementations

Sun Microsystems officially licenses the Java Standard Edition platform for Microsoft Windows,
Linux, and Solaris. Through a network of third-party vendors and licensees,[12] alternative Java
environments are available for these and other platforms. To qualify as a certified Java licensee, an
implementation on any particular platform must pass a rigorous suite of validation and compatibility
tests. This method enables a guaranteed level of compliance and platform through a trusted set of
commercial and non-commercial partners.

Sun's trademark license for usage of the Java brand insists that all implementations be "compatible".
This resulted in a legal dispute with Microsoft after Sun claimed that the Microsoft implementation
did not support the RMI and JNI interfaces and had added platform-specific features of their own.
Sun sued and won both damages in 1997 (some $20 million) and a court order enforcing the terms of
the license from Sun. As a result, Microsoft no longer ships Java with Windows, and in recent
versions of Windows, Internet Explorer cannot support Java applets without a third-party plugin.
However, Sun and others have made available Java run-time systems at no cost for those and other
versions of Windows.

Platform-independent Java is essential to the Java Enterprise Edition strategy, and an even more
rigorous validation is required to certify an implementation. This environment enables portable
server-side applications, such as Web services, servlets, and Enterprise JavaBeans, as well as with
Embedded systems based on OSGi, using Embedded Java environments. Through the new GlassFish
project, Sun is working to create a fully functional, unified open-source implementation of the Java
EE technologies.

Automatic memory management

One of the ideas behind Java's automatic memory management model is that programmers be spared
the burden of having to perform manual memory management. In some languages the programmer
allocates memory for the creation of objects stored on the heap and the responsibility of later
deallocating that memory also resides with the programmer. If the programmer forgets to deallocate
memory or writes code that fails to do so, a memory leak occurs and the program can consume an
arbitrarily large amount of memory. Additionally, if the program attempts to deallocate the region of
memory more than once, the result is undefined and the program may become unstable and may
crash. Finally, in non garbage collected environments, there is a certain degree of overhead and
complexity of user-code to track and finalize allocations. Often developers may box themselves into
certain designs to provide reasonable assurances that memory leaks will not occur.[13]

In Java, this potential problem is avoided by automatic garbage collection. The programmer
determines when objects are created, and the Java runtime is responsible for managing the object's
lifecycle. The program or other objects can reference an object by holding a reference to it (which,
from a low-level point of view, is its address on the heap). When no references to an object remain,
the unreachable object is eligible for release by the Java garbage collector - it may be freed
automatically by the garbage collector at any time. Memory leaks may still occur if a programmer's
code holds a reference to an object that is no longer needed—in other words, they can still occur but
at higher conceptual levels.

The use of garbage collection in a language can also affect programming paradigms. If, for example,
the developer assumes that the cost of memory allocation/recollection is low, they may choose to
more freely construct objects instead of pre-initializing, holding and reusing them. With the small
cost of potential performance penalties (inner-loop construction of large/complex objects), this
facilitates thread-isolation (no need to synchronize as different threads work on different object
instances) and data-hiding. The use of transient immutable value-objects minimizes side-effect
programming.

Comparing Java and C++, it is possible in C++ to implement similar functionality (for example, a
memory management model for specific classes can be designed in C++ to improve speed and lower
memory fragmentation considerably), with the possible cost of adding comparable runtime overhead
to that of Java's garbage collector, and of added development time and application complexity if one
favors manual implementation over using an existing third-party library. In Java, garbage collection
is built-in and virtually invisible to the developer. That is, developers may have no notion of when
garbage collection will take place as it may not necessarily correlate with any actions being
explicitly performed by the code they write. Depending on intended application, this can be
beneficial or disadvantageous: the programmer is freed from performing low-level tasks, but at the
same time loses the option of writing lower level code. Additionally, the garbage collection
capability demands some attention to tuning the JVM, as large heaps will cause apparently random
stalls in performance.

Java does not support pointer arithmetic as is supported in, for example, C++. This is because the
garbage collector may relocate referenced objects, invalidating such pointers. Another reason that
Java forbids this is that type safety and security can no longer be guaranteed if arbitrary
manipulation of pointers is allowed.

Syntax

The syntax of Java is largely derived from C++. However, unlike C++, which combines the syntax
for structured, generic, and object-oriented programming, Java was built exclusively as an object
oriented language. As a result, almost everything is an object and all code is written inside a class.
The exceptions are the intrinsic data types (ordinal and real numbers, boolean values, and
characters), which are not classes for performance reasons.

Applet

Java applets are programs that are embedded in other applications, typically in a Web page displayed
in a Web browser.

Performance

Java's performance has improved substantially since the early versions, and performance of JIT
compilers relative to native compilers has in some tests been shown to be quite similar.[16][17][18] The
performance of the compilers does not necessarily indicate the performance of the compiled code;
only careful testing can reveal the true performance issues in any system.

In a paper written in 1999 by Lutz Prechelt it is outlined that, statistically, programmer efficiency
and experience has a bearing many standard deviations greater on run-time and memory usage than
language choice. This paper specifically uses Java as a basis for the comparison, due to its then bad
reputation.[19] Sun Microsystems have taken considerable trouble to address these problems, and
regularly produce white papers on this topic.[20] A more recent study (2003–4) gives Java a
comparable performance to C++.[21]

Look and feel

The default look and feel of GUI applications written in Java using the Swing toolkit is very
different from native applications. It is possible to specify a different look and feel through the
pluggable look and feel system of Swing. Clones of Windows, GTK and Motif are supplied by Sun.
Apple also provides an Aqua look and feel for Mac OS X. Though prior implementations of these
look and feels have been considered lacking, Swing in Java SE 6 addresses this problem by using
more native widget drawing routines of the underlying platforms. Alternatively, third party toolkits
such as wx4j, Qt Jambi or SWT may be used for increased integration with the native windowing
system.
Object orientation caveat

As in C++ and some other object-oriented languages, variables of Java's primitive types were not
originally objects. Values of primitive types are either stored directly in fields (for objects) or on the
stack (for methods) rather than on the heap, as is the common case for objects (but see Escape
analysis). This was a conscious decision by Java's designers for performance reasons. Because of
this, Java was not considered to be a pure object-oriented programming language. However, as of
Java 5.0, autoboxing enables programmers to write as if primitive types are their wrapper classes,
with their object-oriented counterparts representing classes of their own, and freely interchange
between them for improved flexibility.

Lack of features

Unlike C++, Java suppresses several features (such as operator overloading and multiple inheritance)
for classes in order to simplify the language, to "save the programmers from themselves", and to
prevent possible errors and anti-pattern design. This has been a source of criticism, relating to a lack
of low-level features, but some of these limitations may be worked around. Java interfaces have
always had multiple inheritance.

Communications API

Sun does not have an official Java API for USB. There is, however, support for the Serial Port and
Parallel Port via JavaComm and Bluetooth support via JSR082. There is also third party support for
USB.[22]

Resources
Java Runtime Environment

The Java Runtime Environment, or JRE, is the software required to run any application deployed on
the Java Platform. End-users commonly use a JRE in software packages and Web browser plugins.
Sun also distributes a superset of the JRE called the Java 2 SDK (more commonly known as the
JDK), which includes development tools such as the Java compiler, Javadoc, Jar and debugger.

One of the unique advantages of the concept of a runtime engine is that errors (exceptions) should
not 'crash' the system. Moreover, in runtime engine environments such as Java there exist tools that
attach to the runtime engine and every time that an exception of interest occurs they record
debugging information that existed in memory at the time the exception was thrown (stack and heap
values). These Automated Exception Handling tools provide 'root-cause' information for exceptions
in Java programs that run in production, testing or development environments.

Components

• Java libraries are the compiled byte codes of source code developed by the JRE implementor
to support application development in Java. Examples of these libraries are:
o The core libraries, which include:
 Collection libraries which implement data structures such as lists, dictionaries,
trees and sets
 XML Processing (Parsing, Transforming, Validating) libraries
 Security
 Internationalization and localization libraries
o The integration libraries, which allow the application writer to communicate with
external systems. These libraries include:
 The Java Database Connectivity (JDBC) API for database access
 Java Naming and Directory Interface (JNDI) for lookup and discovery
 RMI and CORBA for distributed application development
o User Interface libraries, which include:
 The (heavyweight, or native) Abstract Windowing Toolkit (AWT), which
provides GUI components, the means for laying out those components and the
means for handling events from those components
 The (lightweight) Swing libraries, which are built on AWT but provide (non-
native) implementations of the AWT widgetry
 APIs for audio capture, processing, and playback
• A platform dependent implementation of Java virtual machine (JVM) which is the means by
which the byte codes of the Java libraries and third party applications are executed
• Plugins, which enable applets to be run in Web browsers
• Java Web Start, which allows Java applications to be efficiently distributed to end users
across the Internet
• Licensing and documentation

APIs

Sun has defined three platforms targeting different application environments and segmented many of
its APIs so that they belong to one of the platforms. The platforms are:

• Java Platform, Micro Edition (Java ME) — targeting environments with limited resources,
• Java Platform, Standard Edition (Java SE) — targeting workstation environments, and
• Java Platform, Enterprise Edition (Java EE) — targeting large distributed enterprise or
Internet environments.

The classes in the Java APIs are organized into separate groups called packages. Each package
contains a set of related interfaces, classes and exceptions. Refer to the separate platforms for a
description of the packages available.

The set of APIs is controlled by Sun Microsystems in cooperation with others through the Java
Community Process program. Companies or individuals participating in this process can influence
the design and development of the APIs. This process has been a subject of controversy

SYSTEM DESIGN

The design phase begins when the requirement specification document for the
system to be developed is available. While the requirement specification activity is entirely
a problem domain, design is the first step to move from the problem domain towards the
solution domain. Design is essentially the bridge between requirement specification and the
final solution for satisfying the requirements .

System design is an interactive process through which requirements are


translated into a blueprint or a representation of software that can be accessed for quality
before code generation begins . Fundamental software design concepts provide the
necessary framework for getting right information.

DESIGN PRINCIPLE

The top-down design approach has been used to design the system. Top-down
approach starts by identifying the higher level components of the system. In other words,
the major components of the system are identified first and then exploded to identify the
minor components. Starting from identifying the users of the system, the various
functionalities required are identified and the whole thing is integrated to form the complete
system.

DESIGN METHODOLOGY

Creating a software system is the major concern of the design phase. The aim of
the design methodologies is not to reduce the process of design to a sequence of
mechanical steps, but to provide guidelines to aid the designer during design process.
Each module in this system are developed such that they had least interconnections
between them. In other words change done to a module does not affect the other modules.
Finally, at the integration phase, all independent modules are integrated to form the
required targeted system.

SCREEN DESIGN

Screen design is very important in a web based application . These screens


represent the interface for interaction with the users of the system . Without quality GUI ,
the entire system may appear so unnecessary that users will avoid using it . The right GUI
must be developed , while ensuring that each of its elements is designed so that people will
find the system easy to use effectively . It includes the following considerations :
 Collecting only required data and grouping similar or related data
 Depending on the option, the necessary help messages are displayed
 Error or Exception information handling is properly provided
 Consistent terminologies are used throughout the system
 Very user friendly

DESIGN METHODOLOGY

Creating a software system is the major concern of the design phase. The aim of
the design methodologies is not to reduce the process of design to a sequence of
mechanical steps, but to provide guidelines to aid the designer during design process.
Each module in this system are developed such that they had least interconnections
between them. In other words change done to a module does not affect the other modules.
Finally, at the integration phase, all independent modules are integrated to form the
required targeted system.

SYSTEM DEVELOPMENT

The next phase is the system development, which translates the design into a
machine-readable form. The coding process performs this task .As the design is performed
in detailed manner, code generation can be accomplished mechanically. All the software-
engineering steps that have been presented up to this point are directed towards a final
objective of translating the models into the software form . Coding is viewed as a natural
consequence of design.

Development Guidelines
The coding is done with the following characteristics in mind:
 Ease of design to Code translation

 Code efficiency

 Memory efficiency

 Source code portability

 Maintainability

 Security

 Simple and easy to understand

 Efficient logic

Efficiency

In well engineered systems , there is a natural tendency to use critical


resources efficiently . This efficiency in the system is achieved by putting most of the
validation burden on the front end itself.

Coding

To have a coding style or standard, programming standards were framed . All the
software development activities of the system will conform itself to the specified
standards .The standards include the following :

 Proper documentation and indentation standards at all level

 Avoiding global variables as much as possible , to save memory, to avoid side effect

 Raising exception whenever necessary

 Naming conventions should be followed

 Tables should be indexed


Care is taken to ensure that invalid data is informed to the user with proper error
messages immediately. The user has to then provide proper data to the system upon which
entry is made in the database. Coding standards have been established. The name of the
tables are given according to its uses.
Null Values
The columns, which are created with not null option, will be checked
automatically during the insertion or updating or records into the files. The system also
checks for not null values so that any form that has to be entered is not left empty. If the
user forgets to enter any data into a form field, she/he is given a message and focus is
made to that particular field which makes the user to necessarily enter data.
Structured Chart

Definition of the modules and their relationship to one another are represented in
a structured chart. Structured design partitions a program into small, independent modules.
They are arranged in a hierarchy that approximates a model of the business area and is
organized in a top-down manner with the details shown at the bottom. Thus, structured
design is an attempt to minimize complexity and make a problem manageable by
subdividing it into smaller segments, which is called modularization or decomposition. The
structured chart for the Email Viewer is given below

Structural Chart

FLIGHT RESERVATION

DOMESTIC
INTERNATIONAL
FLIGHTS
FLIGHTS
Conceptual Data Model

A data model is a type of abstraction that is used to provide users with a


conceptual representation of data that does not include many of the physical
implementation details in the database. Entity-Relationship Model (ER Model) is a model
that describes the stored data layout of a system at a high level of abstraction. Entity
Relationship Diagram (ERD) enables us to examine, and highlight data structures and
relationships independent of the process and control flow. Based on the information provide
by the ERD, the kind of keys or indexes needed to access the database records can be
determined.
DATA DICTIONARY

A Data Dictionary is a catalogue - of all elements in a system. It is a document that


collects co-ordinates and confirms what a specific data term mean to different people in the
organisation. It is the basic reference work for finding the names and attributes of data
elements used through out the system. These elements centre on data and the way they
are structured to meet user requirements and organisation needs. It is a must that all data
elements are included in the data dictionary. The major elements are data flows, data
stores and processes. Data Dictionary stores details and descriptions of these elements.

A well-developed Data Dictionary should be able to provide the following


information:

• How many characters are in a data item (data element, field)?

• By what names it is referenced in the system?

• Where it is used in the system?


Data Flow Diagram

Data Flow Diagram is a graphic tool. It is used to describe and analyse the
movement of data through a system-manual or automated. They focus on the data flowing
in to system, between processes and in and out of data stores. This is a central tool and
the basis from which other components are developed. The system models are termed as
Data Flow Diagram (DFD).
Develop the data flow diagram using top- down approach. Make a list of external
entries, dataflows, processes, and data stores. This determines the boundary of the
system. Draw a basic data flow diagram – Context Diagram, showing just the overview.
This is done by identifying the main process of the system. Fill in the details, explaining the
context diagram. Add more detail or steps within each process and add exceptions
whenever necessary. Deriving the logical view from the physical view.
The Initial context diagram should be an overview including basic inputs, processes,
and outputs. This will be the most general diagram, really a bird’s eye view of data
movement in the system. This is called taking a “top-down approach” to diagramming data
movement. With a top-down approach, the diagrams move from general to specific. While
the first diagram helps the system analyst grasp basic data movement its general nature
limits its usefulness.
DFD’s are quite easy to read and understand. Four simple notations are sufficient to
complete a DFD.
1. Data Flow.
2. Process.
3. External Entities.
Data Store.
DATA FLOW DIAGRAM

CHECK USER NAME


PASSWORD

DOMESTIC FLIGHTS
MODULS

Reserve
COMPLETE RESERV
FLIGHT LIST PASSENGER
E/VIEW
DETAILS
View

ENTER THE FLIGHT NO


Yes
RESERVE THE
IF SEAT SEAT
AVAIL
ABLE
FLIGHT’S SEAT & OTHER
INFORMATION

No
RESERVATION
LIST

GO TO MAIN PAGE
DATA FLOW DIAGRAM

CHECK USER NAME


PASSWORD

INTRENATIONAL
FLIGHT MODULS

View
COMPLETE RESERVE/ PASSENGER
FLIGHT LIST VIEW DETAILS

Reserve
Yes
IF RESERVE THE
ENTER THE FLIGHT NO
SEAT SEAT
AVAIL
ABLE
No
FLIGHT’S SEATS &
OTHER INFORMATION
GO TO MAIN PAGE
RESERVATION
LIST
TESTING

Software testing is a critical element of software quality assurance and


delineates the pre-eminent review of specification, design, and coding. Testing takes forty-
percent time of the whole project. Testing for Email Viewer includes Unit test, Integration
test and System test. Test case are designed for each of these tests and the functionality
are tested to meet the requisite.
The objective of testing for Email Viewer is to execute a program with the intent
of finding an error. A good test case is one that has a high probability of finding an
undiscovered error. A successful test is one that uncovers an undiscovered error. Testing
cannot show the truancy of defects, but it can only show that software defects are extant.
Testing is an assortment of activities that can be planned in advance and conducted
immaculately. For this reason, a template for software testing should be defined for the
software engineering process. A strategy for software testing must accommodate low-level
tests that are obligatory to corroborate that a small source code segment has been
correctly rigged, as well as high-level tests that corroborate major system functions, contra
customer requisite.

Unit Testing

Unit testing focuses corroboration effort on the smallest unit of software design –
the module. Unit Testing in Email Viewer is performed exclusively for each module. Test
cases are designed for each of the modules. Using the detail portrayal as a guide,
important control paths are tested to uncover errors within the boundary of the module. The
relative intricacy of tests and the errors detected as a result is limited by the impelled scope
established for unit testing. The unit test is always white box-oriented, and the step can be
conducted in parallel for multiple modules.
Integration Testing

Integration testing is a systematic technique for barn-raising the program


structure, while at the same time conducting tests to disclose errors analogous with
interfacing. The objective is to take unit-tested modules and build a program structure that
has been decreed by design. In Email Viewer, the unit-tested modules are integrated
together and checked for its conformance with the design. The integration test proceedings
for Email Viewer is given below. There is oft a proclivity to aspire for a non-incremental
integration; that is, to construct the program using the big bang approach. All modules are
conglomerated in advance. When the entire program is tested as a whole, chaos usually
results. Assortment of errors is encountered. Correction is arduous, because, the solitude
of causes is convulted by the vast expanse of the entire program. Once these errors are
mended, new ones emerge and the process continues in an ostensibly illimitable loop.

Validation Testing

At the culmination of integration testing, the Email Viewer is completely


contrived as a package. Interface errors being unveiled and mended the final series of
software tests begin. Validation can be defined in many ways, but a simple definition is that
validation succeeds when the software functions in a manner, that can be reasonably
expected by the customer. Reasonable expectations are defined in the software
Requirements Specification – a document that describes all user-visible attributes of the
software. The specification for Email Viewer contains a section called Validation Criteria.
Information contained in that section silhouette the basis for a validation testing approach.

System Testing

Ultimately, software is incorporated with other system elements and a serious of


system integration and validation tests are conducted. These tests fall outside the scope of
the software engineering process and are not conducted solely by the software developer.
System testing for Email Viewer consist of testing the database when it overflows, the
latency during search when the database is big, inappropriate keys being pressed, et
cetera. System testing is de facto a series of different tests whose ordinate aspiration is to
fully exercise the computer-based system. Although each test has a different purpose, all
work should corroborate that all system elements have been properly integrated and
perform allocated functions.
APPNDIX

SAMPLE SCREEN SHOTS


Sample Source Code:

LoginPage.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

import javax.swing.text.*;

public class LoginPage extends JFrame


{
Container c = getContentPane();
JPanel PFlightTypes = new JPanel(null);
JPanel PLogin = new JPanel(null);
JPanel PFlightDetails = new JPanel(null);

public boolean bCheck=true;

JLabel LDomesticFlight = new JLabel("<html><B>Domestic


Flights</B></html>");
JLabel LInternationalFlight = new JLabel("<html><B>International
Flights</B></html>");

JLabel LUserName, LPassword;

JLabel LDomesticFlight1 = new JLabel("<html><B>Domestic Flight


Booking</B></html>");
JLabel LInternationalFlight1 = new JLabel("<html><B>International Flight
Booking</B></html>");

JTextField TFUserName;
JPasswordField TPPassword;

JButton BLogin;

final Object[] col1 ={ "From", "To", "Price", "Time" };


final Object[] col2 = { "From", "To", "Price", "Time" };
final Object[] col3 = { "From", "To", "Price", "Time" };

final Object[][] row1 = { { "Trivandrum", "Bangalore", "3125", "16:30" },


{ "Trivandrum", "Chennai ", "3225", "19:00" }, { "Trivandrum", "Delhi", "1425 ", "08:30" },
{ "Trivandrum", "Goa", "1025 ", "09:50" }, { "Trivandrum", "Hyderabad", "1525", "11:00" },
{ "Trivandrum", "Kolkata", "3825 ", "05:30" }, { "Trivandrum", "Lucknow", "3025 ", "05:30" },
{ "Trivandrum", "Mumbai", "1725", "12:00" }, { "Trivandrum", "Vishakapatnam", "3725",
"19:00" } };
final Object[][] row2 = { { "Trivandrum", "Bali", "21485", "06:20" },
{ "Trivandrum", "Bangkok", "9000", "20:45" }, { "Trivandrum", "Cairo", "22975", "10:25" },
{ "Trivandrum", "CapeTown", "42500", "16:45" }, { "Trivandrum", "Chicago", "35000", "06:30" },
{ "Trivandrum", "Dubai", "12000", "08:15" }, { "Trivandrum", "Frankfurt", "18500", "06:50" },
{ "Trivandrum", "HongKong", "20845", "12:00" }, { "Trivandrum", "Istanbul", "22000", "10:45" },
{ "Trivandrum", "London", "22600", "14:35" }, { "Trivandrum", "LosAngeles", "35000", "22:00" },
{ "Trivandrum", "Melbourne", "27800", "21:15" }, { "Trivandrum", "New York", "32000",
"08:50" }, { "Trivandrum", "Paris", "18500", "18:45" }, { "Trivandrum", "Rome", "19900",
"20:00"}, { "Trivandrum", "SanFrancisco", "35000", "12:00"}, { "Trivandrum", "shanghai",
"24430", "10:15" }, { "Trivandrum", "Singapore", "9000", "21:10" }, { "Trivandrum", "Sydney",
"27800", "12:00"}, { "Trivandrum", "Toronto", "35000", "17:00 " } };
final Object[][] row3 = { { "Trivandrum", "Bangalore", "9375", "16:30" },
{ "Trivandrum", "Chennai ", "9675", "19:00" }, { "Trivandrum", "Delhi", "4275", "08:30" },
{ "Trivandrum", "Goa", "3075", "09:50" }, { "Trivandrum", "Hyderabad", "4575", "11:00" },
{ "Trivandrum", "Kolkata", "11475", "05:30" }, { "Trivandrum", "Lucknow", "9075", "05:30" },
{ "Trivandrum", "Mumbai", "5175", "12:00" }, { "Trivandrum", "Vishakapatnam", "11175", "19:00"
} };
final Object[][] row4 = { { "Trivandrum", "Bali", "64455", "06:20" },
{ "Trivandrum", "Bangkok", "27000", "20:45" }, { "Trivandrum", "Cairo", "68925", "10:25" },
{ "Trivandrum", "CapeTown", "37500", "16:45" }, { "Trivandrum", "Chicago", "105000",
"06:30" }, { "Trivandrum", "Dubai", "36000", "08:15" }, { "Trivandrum", "Frankfurt", "55500",
"06:50" }, { "Trivandrum", "HongKong", "62535", "12:00" }, { "Trivandrum", "Istanbul", "66000",
"10:45" }, { "Trivandrum", "London", "67800", "14:35" }, { "Trivandrum", "LosAngeles",
"105000", "22:00" }, { "Trivandrum", "Melbourne", "83400", "21:15" }, { "Trivandrum", "New
York", "96000", "08:50" }, { "Trivandrum", "Paris", "55500", "18:45" }, { "Trivandrum", "Rome",
"59700", "20:00" }, { "Trivandrum", "SanFrancisco", "105000", "12:00" }, { "Trivandrum",
"shanghai", "73290", "10:15" }, { "Trivandrum", "Singapore", "27000", "21:10"}, { "Trivandrum",
"Sydney", "83400", "12:00"}, { "Trivandrum", "Toronto", "105000", "17:00" } };

JTable TDomesticFlight = new JTable(row1, col1);


JTable TInternationalFlight = new JTable(row2, col2);
JTable TDomesticFlight1 = new JTable(row3, col3);
JTable TInternationalFlight1 = new JTable(row4, col2);

JScrollPane JSP1 = new JScrollPane(TDomesticFlight,


ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
JScrollPane JSP2 = new JScrollPane(TInternationalFlight,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
JScrollPane JSP3 = new JScrollPane(TDomesticFlight1,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
JScrollPane JSP4 = new JScrollPane(TInternationalFlight1,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);

Icon img1 = new ImageIcon("img/economic.jpg");


Icon img2 = new ImageIcon("img/business.jpg");
Icon img3 = new ImageIcon("img/economic1.jpg");
Icon img4 = new ImageIcon("img/business1.jpg");

JLabel LEconomic = new JLabel("Economic", img1, SwingConstants.LEFT);


JLabel LBusiness = new JLabel("Business", img2, SwingConstants.LEFT);
JLabel LEconomic1 = new JLabel("Economic", img3, SwingConstants.LEFT);
JLabel LBusiness1 = new JLabel("Business", img4, SwingConstants.LEFT);

public LoginPage()
{
WindowUtilities.setNativeLookAndFeel();
setPreferredSize(new Dimension(796,572));

PFlightTypes.setBackground(Color.white);
PLogin.setBackground(Color.white);
PFlightDetails.setBackground(Color.white);

JSP1.setBounds(0, 340, 790, 200);


JSP2.setBounds(0, 340, 790, 200);
JSP3.setBounds(0, 340, 790, 200);
JSP4.setBounds(0, 340, 790, 200);

PFlightTypes.setBounds(0,0,500, 340);
PLogin.setBounds(500,0,350, 340);
PFlightDetails.setBounds(0,340,790,200);

LUserName = new JLabel(" User Name ");


LPassword = new JLabel(" Password ");
TFUserName = new JTextField(10);
TPPassword = new JPasswordField(10);
BLogin = new JButton("Sign In");

LUserName.setBounds(40, 100, 100, 21);


LPassword.setBounds(40, 140, 100, 21);
TFUserName.setBounds(160, 100, 100, 21);
TPPassword.setBounds(160, 140, 100, 21);
BLogin.setBounds(160, 200, 100,25);

LDomesticFlight1.setBounds(60, 60, 138, 20);


LInternationalFlight1.setBounds(60, 100, 153, 20);

PLogin.add(LUserName);
PLogin.add(TFUserName);
PLogin.add(LPassword);
PLogin.add(TPPassword);
PLogin.add(BLogin);

PFlightDetails.add(JSP1);
PFlightDetails.add(JSP2);
PFlightDetails.add(JSP3);
PFlightDetails.add(JSP4);

JSP1.setVisible(true);
JSP2.setVisible(false);
JSP3.setVisible(false);
JSP4.setVisible(false);

LBusiness.setBounds(265, 170, 300, 125);


LEconomic.setBounds(0, 170, 250, 125);
LBusiness1.setBounds(280, 200, 135, 60);
LEconomic1.setBounds(50, 200, 147, 60);

PFlightTypes.add(LEconomic);
PFlightTypes.add(LBusiness);
PFlightTypes.add(LEconomic1);
PFlightTypes.add(LBusiness1);

LBusiness.setVisible(false);
LEconomic1.setVisible(false);
LBusiness1.setVisible(true);
LEconomic.setVisible(true);

LDomesticFlight.setBounds(60, 60, 100, 25);


LInternationalFlight.setBounds(60, 100, 120, 25);

c.add(PFlightTypes);
c.add(PLogin);
c.add(PFlightDetails);

PFlightTypes.add(LDomesticFlight);
PFlightTypes.add(LInternationalFlight);

pack();
setVisible(true);
addWindowListener(new ExitListener());

LDomesticFlight.addMouseListener(new mouse1(this, true));


LInternationalFlight.addMouseListener(new mouse1(this, false));

LDomesticFlight1.addMouseListener(new mouse3(this, true));


LInternationalFlight1.addMouseListener(new mouse3(this, false));

LBusiness1.addMouseListener(new mouse2(this, true));


LEconomic1.addMouseListener(new mouse2(this, false));

BLogin.addActionListener(new button1(this));
}

public static void main(String args[])


{
new LoginPage();
}
}

class button1 implements ActionListener


{
LoginPage type;
char[] cCheck, cPassword={'a','d','m','i','n','\0'};
JFrame f;
String sCheck,sCheck1="admin";

public button1(LoginPage type)


{
this.type = type;
}
public void actionPerformed(ActionEvent e)
{
cCheck=type.TPPassword.getPassword();
sCheck = type.TFUserName.getText();
if ((sCheck1.equals(sCheck)) && check())
{
type.PLogin.add(type.LDomesticFlight1);
type.PLogin.add(type.LInternationalFlight1);

type.PLogin.remove(type.LUserName);
type.PLogin.remove(type.TFUserName);
type.PLogin.remove(type.LPassword);
type.PLogin.remove(type.TPPassword);
type.PLogin.remove(type.BLogin);

type.c.repaint();
}
else
{
JOptionPane.showMessageDialog(null, "Invalid username or
password. Try again");
}
}
public boolean check()
{
if (cCheck.length >= 6 || cCheck.length < 4)
return false;
for(int i=0;i<=4;i++)
{
if(cCheck[i]!=cPassword[i])
return false;
}
return true;
}
}

class mouse1 extends MouseAdapter


{
LoginPage type;
boolean bCheck;

public mouse1(LoginPage type, boolean bCheck)


{
this.type = type;
this.bCheck = bCheck;
}
public void mouseEntered(MouseEvent e)
{

type.LDomesticFlight.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

type.LInternationalFlight.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
public void mouseClicked(MouseEvent e)
{
if(bCheck)
type.bCheck = true;
else
type.bCheck = false;
type.LEconomic.setVisible(true);
type.LBusiness1.setVisible(true);
type.LEconomic1.setVisible(false);
type.LBusiness.setVisible(false);

type.JSP1.setVisible(false);
type.JSP2.setVisible(false);
type.JSP3.setVisible(false);
type.JSP4.setVisible(false);
if(bCheck)
type.JSP1.setVisible(true);
else
type.JSP2.setVisible(true);
}
}

class mouse3 extends MouseAdapter


{
LoginPage type;
boolean bCheck;

public mouse3(LoginPage type, boolean bCheck)


{
this.type = type;
this.bCheck = bCheck;
}
public void mouseEntered(MouseEvent e)
{

type.LDomesticFlight1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

type.LInternationalFlight1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
public void mouseClicked(MouseEvent e)
{
if (bCheck)
new DomesticFlight(type);
else
new InternationalFlight(type);
}
}

class mouse2 extends MouseAdapter


{
LoginPage type;
boolean bCheck;

public mouse2(LoginPage type, boolean bCheck)


{
this.type = type;
this.bCheck = bCheck;
}
public void mouseEntered(MouseEvent e)
{

type.LEconomic1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));

type.LBusiness1.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
public void mouseClicked(MouseEvent e)
{
if(type.bCheck)
{
if (bCheck)
{
type.LBusiness1.setVisible(false);
type.LBusiness.setVisible(true);
type.LEconomic.setVisible(false);
type.LEconomic1.setVisible(true);
type.JSP1.setVisible(false);
type.JSP2.setVisible(false);
type.JSP3.setVisible(true);
type.JSP4.setVisible(false);
}
else
{
type.LEconomic1.setVisible(false);
type.LBusiness.setVisible(false);
type.LBusiness1.setVisible(true);
type.LEconomic.setVisible(true);
type.JSP1.setVisible(true);
type.JSP2.setVisible(false);
type.JSP3.setVisible(true);
type.JSP4.setVisible(false);
}
}
else
{
if (bCheck)
{
type.LBusiness1.setVisible(false);
type.LBusiness.setVisible(true);
type.LEconomic.setVisible(false);
type.LEconomic1.setVisible(true);
type.JSP1.setVisible(false);
type.JSP2.setVisible(false);
type.JSP3.setVisible(false);
type.JSP4.setVisible(true);
}
else
{
type.LEconomic1.setVisible(false);
type.LBusiness.setVisible(false);
type.LBusiness1.setVisible(true);
type.LEconomic.setVisible(true);
type.JSP1.setVisible(false);
type.JSP2.setVisible(true);
type.JSP3.setVisible(false);
type.JSP4.setVisible(false);
}
}
}
}
InternationalFlights.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;

public class InternationalFlight extends JFrame


{
JComboBox CBFrom, CBTo, CBClass, CBAdult, CBChildren, CBInfant;
JLabel LFrom, LTo, LBookingDate, LClass, LAdult, LChildren, LInfant,
LBookingDetails, LPassengerDetails, LDate, LImg1, LImg2, LNotes;
JTextField TFBookingDate;
Icon img1, img2;
JButton BFindFlight;
JPanel PPanel1, PPanel2;

LoginPage type1;

public InternationalFlight(LoginPage type1)


{
Container c =getContentPane();
c.setLayout(new BorderLayout());
String[] sItem1={"Trivandrum"};
String[]
sItem2={"Bali","Bangkok","Cairo","CapeTown","Chicago","Dubai","Frankfurt","HongKong","Ista
nbul","London","LosAngeles","Melbourne","New
York","Paris","Rome","SanFrancisco","shanghai","Singapore","Sydney","Toronto"};
String[] sItem3={"Economic","Business"};

this.type1 = type1;
PPanel1 = new JPanel(null);
PPanel1.setPreferredSize(new Dimension(500,200));

LBookingDetails = new JLabel("<html><b><font


color=\"#C71585\">Booking Details</font></b></html>");
LFrom = new JLabel("From :");
LTo = new JLabel("To :");
LBookingDate = new JLabel("Booking Date:");
LClass = new JLabel("Class :");

CBFrom = new JComboBox(sItem1);


CBTo = new JComboBox(sItem2);
CBClass = new JComboBox(sItem3);

TFBookingDate = new JTextField(10);


LDate = new JLabel("(DD/MM/YYYY)");
LDate.setForeground(Color.red);

img1=new ImageIcon("map1.jpg");
LImg1 = new JLabel(img1);

BFindFlight = new JButton("Find Flight");

LBookingDetails.setBounds(20,3,100,20);

LFrom.setBounds(20,40,100,20);
CBFrom.setBounds(100,40,100,20);

LTo.setBounds(20,100,100,20);
CBTo.setBounds(100,100,100,20);

LBookingDate.setBounds(14,160,100,20);
TFBookingDate.setBounds(100,160,100,20);
LDate.setBounds(210,160,100,20);

LClass.setBounds(20,220,100,20);
CBClass.setBounds(100,220,100,20);

BFindFlight.setBounds(50,270,100,25);

LImg1.setBounds(0,290,495,260);

PPanel1.add(LBookingDetails);
PPanel1.add(LFrom);
PPanel1.add(CBFrom);
PPanel1.add(LTo);
PPanel1.add(CBTo);
PPanel1.add(LBookingDate);
PPanel1.add(TFBookingDate);
PPanel1.add(LDate);
PPanel1.add(LClass);
PPanel1.add(CBClass);
PPanel1.add(BFindFlight);
PPanel1.add(LImg1);
PPanel1.setBackground(Color.white);

c.add(PPanel1,BorderLayout.WEST);

PPanel2 = new JPanel(null);


PPanel2.setPreferredSize(new Dimension(320,160));
LPassengerDetails=new JLabel("<html><b><font
color=\"#C71585\">PassengerDetails</font></b></html>");

LAdult = new JLabel("Adults(12+)");

LChildren = new JLabel("Children(2-11)");


LInfant = new JLabel("Infants(under 2)");

String[] item4={"1","2","3","4","5","6"};
CBAdult = new JComboBox(item4);

String[] item5={"0","1","2","3","4"};
CBChildren = new JComboBox(item5);

String[] item6={"0","1","2","3"};
CBInfant = new JComboBox(item6);

img2 = new ImageIcon("note_bg.gif");


LImg2 = new JLabel(img2);
LNotes = new JLabel("<html><body><p>NOTE: Bookings with International
Credit Cards <p> have temporarily been suspended.This Service<p> will resume shortly and we will
have a notice<p> posted on our website.We regret any <p>inconvenience caused to our
passengers.</body></html>");

LPassengerDetails.setBounds(40,3,100,20);

LAdult.setBounds(40,40,100,20);
CBAdult.setBounds(140,40,100,20);

LChildren.setBounds(40,105,100,20);
CBChildren.setBounds(140,105,100,20);

LInfant.setBounds(40,170,100,20);
CBInfant.setBounds(140,170,100,20);

LImg2.setBounds(16,220,320,200);
LNotes.setBounds(55,240,380,180);

PPanel2.add(LPassengerDetails);
PPanel2.add(LAdult);
PPanel2.add(LChildren);
PPanel2.add(LInfant);
PPanel2.add(CBAdult);
PPanel2.add(CBChildren);
PPanel2.add(CBInfant);
PPanel2.add(LNotes);
PPanel2.add(LImg2);

PPanel2.setBackground(Color.white);

c.add(PPanel2,BorderLayout.EAST);

setSize(795,580);
setVisible(true);

BFindFlight.addActionListener(new button2(this, type1));


}
public static void main(String args[])
{
LoginPage type1=null;
new InternationalFlight(type1);
}
}

class button2 implements ActionListener


{
InternationalFlight type;
LoginPage type1;
button2(InternationalFlight type, LoginPage type1)
{
this.type = type;
this.type1 = type1;
}
public void actionPerformed(ActionEvent e)
{
String sFrom = (String)type.CBFrom.getSelectedItem();
String sTo = (String)type.CBTo.getSelectedItem();
String sClass = (String)type.CBClass.getSelectedItem();
String sBookingDate = type.TFBookingDate.getText();
Integer iPrice=0;
String sTime="";

Integer iAdult = Integer.parseInt((String)type.CBAdult.getSelectedItem());


Integer iChildren =
Integer.parseInt((String)type.CBChildren.getSelectedItem());
Integer iInfant = Integer.parseInt((String)type.CBInfant.getSelectedItem());

int i = 0;

if(sClass.equals("Economic"))
{
try{
while(i<20)
{
if(type1.row2[i][1].equals(sTo))
{
iPrice = Integer.parseInt((String)type1.row2[i]
[2]);
sTime = (String)type1.row2[i][3];
break;
}
i++;
}
}catch(Exception e1)
{
JOptionPane.showMessageDialog(null, "You have no rights to
access");
System.exit(0);
}
}
else
{
try
{
while(i<20)
{
if(type1.row2[i][1].equals(sTo))
{
iPrice = Integer.parseInt((String)type1.row4[i]
[2]);
sTime = (String)type1.row4[i][3];
break;
}
i++;
}
}catch(Exception e1)
{
JOptionPane.showMessageDialog(null, "You have no rights to
access it");
System.exit(0);
}
}
type.setTitle(iPrice + " " + sTime);

iPrice = (iPrice*iAdult)+(iPrice*(iChildren/2));
int iCount=0;
int iSeatCount=0;

String[] sTempFrom=new String[1250];


String[] sTempTo=new String[1250];
String[] sTempClass=new String[1250];
String[] sTempBookingDate=new String[1250];
String[] sTempTime=new String[1250];
Integer[] iTempAdult=new Integer[1250];
Integer[] iTempChildren=new Integer[1250];
Integer[] iTempInfant=new Integer[1250];
Integer[] iTempPrice=new Integer[1250];

try
{
//read from data
Save1 save1;
ObjectInputStream OIS1 = new ObjectInputStream(new
FileInputStream("save1"));
do
{
save1 = (Save1)OIS1.readObject();
sTempFrom[iCount] = save1.sFrom;
sTempTo[iCount] = save1.sTo;
sTempClass[iCount] = save1.sClass;
sTempBookingDate[iCount] = save1.sBookingDate;
sTempTime[iCount] = save1.sTime;
iTempAdult[iCount] = save1.iAdult;
iTempChildren[iCount] = save1.iChildren;
iTempInfant[iCount] = save1.iInfant;
iTempPrice[iCount] = save1.iPrice;

iCount++;
if(save1.sBookingDate.equals(sBookingDate))
if(save1.sTo.equals(sTo))
iSeatCount=iSeatCount + save1.iAdult +
save1.iChildren + save1.iInfant;
}while(save1!=null);
OIS1.close();

}
catch(Exception e1)
{
}

iSeatCount = iSeatCount + iAdult + iChildren + iInfant;


if(iSeatCount > 60)
{
JOptionPane.showMessageDialog(null,"Seats are full. Sorry!");
}
else
{
int iChoice = JOptionPane.showConfirmDialog(null,"Seats available.
Do you want to Book now?");
if(iChoice == JOptionPane.YES_OPTION)
{
new PrintTicket1(sFrom, sTo, sClass, iAdult, iChildren,
iInfant, sBookingDate, iPrice, sTime);
try
{
//write into data
Save1 save2=new Save1(sFrom, sTo, sClass, iAdult, iChildren,
iInfant, sBookingDate, iPrice, sTime);
ObjectOutputStream OOS1 = new ObjectOutputStream(new
FileOutputStream("save1"));
for(i=0;i<iCount;i++)
{
Save1 temp1=new Save1(sTempFrom[i], sTempTo[i],
sTempClass[i], iTempAdult[i], iTempChildren[i], iTempInfant[i], sTempBookingDate[i],
iTempPrice[i], sTempTime[i]);
OOS1.writeObject(temp1);
System.out.println(temp1);
}
OOS1.writeObject(save2);
OOS1.close();
}catch(Exception e1)
{
System.out.println(e1);
}
}
else
{
}
}
}
}

class Save1 implements Serializable


{
String sFrom, sTo, sClass, sBookingDate, sTime;
Integer iPrice, iAdult, iChildren, iInfant;
// int iCount;
public Save1(String sFrom, String sTo, String sClass, Integer iAdult, Integer
iChildren, Integer iInfant, String sBookingDate, Integer iPrice, String sTime)
{
this.sFrom=sFrom;
this.sTo=sTo;
this.sClass=sClass;
this.iAdult=iAdult;
this.iChildren=iChildren;
this.iInfant=iInfant;
this.sBookingDate=sBookingDate;
this.iPrice=iPrice;
this.sTime=sTime;
// this.iCount = iCount;
}
public String toString()
{
return sFrom+" "+sTo+" "+sClass+" "+iAdult+" "+iChildren+" "+iInfant+"
"+sBookingDate+" "+iPrice+" "+sTime;
}
}
PrintTickets1.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class PrintTicket1 extends JFrame


{
public PrintTicket1(String sFrom, String sTo, String sClass, Integer iAdult,
Integer iChildren, Integer iInfant, String sBookingDate, Integer iPrice, String sTime)
{
Container c=getContentPane();
c.setLayout(new BorderLayout());

JPanel Panel2 = new JPanel(null);

Panel2.setPreferredSize(new Dimension(500,200));

JLabel LTitle = new JLabel("<html><b><font


color=\"#C71585\",size=\"7\">AirLine Ticket</font></b></html>");
JLabel LFrom = new JLabel("<html><b><font color=\"#000000\">From
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;: &nbsp;</font></b><font color=\"#778899\">"+ sFrom+"</font></html>" );
JLabel LTo = new JLabel("<html><font color=\"#000000\">To &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;: &nbsp;</font><font color=\"#778899\">"+sTo+"</font></html>");
JLabel LClass = new JLabel("<html><font color=\"#000000\">Class &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:
&nbsp;</font><font color=\"#778899\">"+sClass+"</font></html>" );
JLabel LBookingDate = new JLabel("<html><font
color=\"#000000\">Traveling Date &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:&nbsp;</font><font
color=\"#778899\">"+ sBookingDate+"</font></html>" );
JLabel LPrice = new JLabel("<html><font color=\"#000000\">Total Price
&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:&nbsp;</font><font
color=\"#778899\">"+ iPrice+"</font></html>" );
JLabel LTime = new JLabel("<html><font color=\"#000000\">DepatureTime
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:&nbsp;</font><font color=\"#778899\">"+
sTime+"</font></html>" );
JLabel LAdult = new JLabel("<html><font color=\"#000000\">Adult &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
&nbsp;: &nbsp;</font><font color=\"#778899\">"+iAdult+"</font></html>" );
JLabel LChildren = new JLabel("<html><font color=\"#000000\">Children
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :
&nbsp;</font><font color=\"#778899\">"+ iChildren+"</font></html>" );
JLabel LInfant = new JLabel("<html><font color=\"#000000\">Infant &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:
&nbsp;</font><font color=\"#778899\">"+iInfant+"</font></html>" );
JLabel LWishes = new JLabel("<html><body><I><font
color=\"#D2B48C\">Wish you a happy journy</font></I></body></html>");

JLabel LTicketNo=new JLabel("<html><font


color=\"#000000\">TicketNumber &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:
&nbsp;</font></html>");
JLabel LBookedBy=new JLabel("<html><font color=\"#000000\">BookedBy
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;: &nbsp;</font></html>");

JLabel LEmpty = new


JLabel("---------------------------------------------------------------------------------------------------------------
------------------------------------------------------------");
JLabel LDemo = new JLabel("<html><U><font
color=\"#8FBC8F\">AirLine-Project Developed By</font></U></html>");
JLabel LFranklin=new JLabel("<html><I><font color=\"#8FBC8F\">R
Franklin Bourgia Singh</font></I></html>");
JLabel LRavi=new JLabel("<html><I><font color=\"#8FBC8F\">V.R Ravi
Sankar</font></I></html>");
JLabel LMayuran=new JLabel("<html><I><font color=\"#8FBC8F\">B
Mayuran</font></I></html>");
JLabel LSathya=new JLabel("<html><I><font
color=\"#8FBC8F\">Sathyaraj</font></I></html>");

LTitle.setBounds(170,15,500,45);
LFrom.setBounds(20,80,300,20);

LTo.setBounds(20,125,300,20);
LClass.setBounds(20,170,300,20);
LBookingDate.setBounds(20,215,300,20);
LPrice.setBounds(20,260,300,20);
LTime.setBounds(20,305,300,20);
LAdult.setBounds(20,345,300,20);
LChildren.setBounds(20,385,300,20);
LInfant.setBounds(20,430,300,20);

LWishes.setBounds(530,435,300,20);

LTicketNo.setBounds(320,80,300,20);
LBookedBy.setBounds(320,125,300,20);
LEmpty.setBounds(3,445,1000,20);

LDemo.setBounds(280,465,300,20);
LFranklin.setBounds(285,485,300,20);
LRavi.setBounds(285,505,300,20);
LMayuran.setBounds(285,525,300,20);
LSathya.setBounds(285,545,300,20);

Panel2.add(LTitle);
Panel2.add(LFrom);
Panel2.add(LTo);
Panel2.add(LClass);
Panel2.add(LBookingDate);
Panel2.add(LAdult);
Panel2.add(LChildren);
Panel2.add(LInfant);
Panel2.add(LPrice);
Panel2.add(LTime);
//Panel2.add(LEmpty);

Panel2.add(LWishes);

Panel2.add(LTicketNo);
Panel2.add(LBookedBy);
Panel2.add(LEmpty);
Panel2.add(LDemo);

Panel2.add(LFranklin);
Panel2.add(LRavi);
Panel2.add(LMayuran);
Panel2.add(LSathya);

Panel2.setBackground(Color.white);

c.add(Panel2, BorderLayout.CENTER);

//pack();
setSize(700,650);
setVisible(true);
}
}
DomesticFlights.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;

public class DomesticFlight extends JFrame


{
JComboBox CBFrom, CBTo, CBClass, CBAdult, CBChildren, CBInfant;
JLabel LFrom, LTo, LBookingDate, LClass, LAdult, LChildren, LInfant,
LBookingDetails, LPassengerDetails, LDate, LImg1, LImg2, LNotes;
JTextField TFBookingDate;
Icon img1, img2;
JButton BFindFlight;
JPanel PPanel1, PPanel2;

LoginPage type1;

public DomesticFlight(LoginPage type1)


{
Container c =getContentPane();
c.setLayout(new BorderLayout());
String[] sItem1={"Trivandrum"};
String[] sItem2 ={ "Bangalore", "Chennai ", "Delhi", "Goa", "Hyderabad",
"Kolkata", "Lucknow", "Mumbai", "Vishakapatnam" };
String[] sItem3={"Economic","Business"};

this.type1 = type1;
PPanel1 = new JPanel(null);
PPanel1.setPreferredSize(new Dimension(500,200));

LBookingDetails = new JLabel("<html><b><font


color=\"#C71585\">Booking Details</font></b></html>");
LFrom = new JLabel("From :");
LTo = new JLabel("To :");
LBookingDate = new JLabel("Booking Date:");
LClass = new JLabel("Class :");

CBFrom = new JComboBox(sItem1);


CBTo = new JComboBox(sItem2);
CBClass = new JComboBox(sItem3);

TFBookingDate = new JTextField(10);


LDate = new JLabel("(DD/MM/YYYY)");
LDate.setForeground(Color.red);

img1=new ImageIcon("map1.jpg");
LImg1 = new JLabel(img1);

BFindFlight = new JButton("Find Flight");

LBookingDetails.setBounds(20,3,100,20);

LFrom.setBounds(20,40,100,20);
CBFrom.setBounds(100,40,100,20);

LTo.setBounds(20,100,100,20);
CBTo.setBounds(100,100,100,20);

LBookingDate.setBounds(14,160,100,20);
TFBookingDate.setBounds(100,160,100,20);
LDate.setBounds(210,160,100,20);

LClass.setBounds(20,220,100,20);
CBClass.setBounds(100,220,100,20);

BFindFlight.setBounds(50,270,100,25);

LImg1.setBounds(0,290,495,260);

PPanel1.add(LBookingDetails);
PPanel1.add(LFrom);
PPanel1.add(CBFrom);
PPanel1.add(LTo);
PPanel1.add(CBTo);
PPanel1.add(LBookingDate);
PPanel1.add(TFBookingDate);
PPanel1.add(LDate);
PPanel1.add(LClass);
PPanel1.add(CBClass);
PPanel1.add(BFindFlight);
PPanel1.add(LImg1);
PPanel1.setBackground(Color.white);

c.add(PPanel1,BorderLayout.WEST);

PPanel2 = new JPanel(null);


PPanel2.setPreferredSize(new Dimension(320,160));
LPassengerDetails=new JLabel("<html><b><font
color=\"#C71585\">PassengerDetails</font></b></html>");

LAdult = new JLabel("Adults(12+)");

LChildren = new JLabel("Children(2-11)");


LInfant = new JLabel("Infants(under 2)");

String[] item4={"1","2","3","4","5","6"};
CBAdult = new JComboBox(item4);

String[] item5={"0","1","2","3","4"};
CBChildren = new JComboBox(item5);

String[] item6={"0","1","2","3"};
CBInfant = new JComboBox(item6);

img2 = new ImageIcon("note_bg.gif");


LImg2 = new JLabel(img2);
LNotes = new JLabel("<html><body><p>NOTE: Bookings with International
Credit Cards <p> have temporarily been suspended.This Service<p> will resume shortly and we will
have a notice<p> posted on our website.We regret any <p>inconvenience caused to our
passengers.</body></html>");

LPassengerDetails.setBounds(40,3,100,20);

LAdult.setBounds(40,40,100,20);
CBAdult.setBounds(140,40,100,20);

LChildren.setBounds(40,105,100,20);
CBChildren.setBounds(140,105,100,20);

LInfant.setBounds(40,170,100,20);
CBInfant.setBounds(140,170,100,20);

LImg2.setBounds(16,220,320,200);
LNotes.setBounds(55,240,380,180);

PPanel2.add(LPassengerDetails);
PPanel2.add(LAdult);
PPanel2.add(LChildren);
PPanel2.add(LInfant);
PPanel2.add(CBAdult);
PPanel2.add(CBChildren);
PPanel2.add(CBInfant);
PPanel2.add(LNotes);
PPanel2.add(LImg2);

PPanel2.setBackground(Color.white);

c.add(PPanel2,BorderLayout.EAST);

setSize(795,580);
setVisible(true);

BFindFlight.addActionListener(new button3(this, type1));


}
public static void main(String args[])
{
LoginPage type1=null;
new DomesticFlight(type1);
}
}

class button3 implements ActionListener


{
DomesticFlight type;
LoginPage type1;
button3(DomesticFlight type, LoginPage type1)
{
this.type = type;
this.type1 = type1;
}
public void actionPerformed(ActionEvent e)
{
String sFrom = (String)type.CBFrom.getSelectedItem();
String sTo = (String)type.CBTo.getSelectedItem();
String sClass = (String)type.CBClass.getSelectedItem();
String sBookingDate = type.TFBookingDate.getText();
Integer iPrice=0;
String sTime="";

Integer iAdult = Integer.parseInt((String)type.CBAdult.getSelectedItem());


Integer iChildren =
Integer.parseInt((String)type.CBChildren.getSelectedItem());
Integer iInfant = Integer.parseInt((String)type.CBInfant.getSelectedItem());

int i = 0;

if(sClass.equals("Economic"))
{
try{
while(i<20)
{
if(type1.row1[i][1].equals(sTo))
{
iPrice = Integer.parseInt((String)type1.row1[i]
[2]);
sTime = (String)type1.row1[i][3];
break;
}
i++;
}
}catch(Exception e1)
{
JOptionPane.showMessageDialog(null, "You have no rights to
access");
System.exit(0);
}
}
else
{
try
{
while(i<20)
{
if(type1.row1[i][1].equals(sTo))
{
iPrice = Integer.parseInt((String)type1.row3[i]
[2]);
sTime = (String)type1.row3[i][3];
break;
}
i++;
}
}catch(Exception e1)
{
JOptionPane.showMessageDialog(null, "You have no rights to
access it");
System.exit(0);
}
}
type.setTitle(iPrice + " " + sTime);

iPrice = (iPrice*iAdult)+(iPrice*(iChildren/2));
int iCount=0;
int iSeatCount=0;

String[] sTempFrom=new String[1250];


String[] sTempTo=new String[1250];
String[] sTempClass=new String[1250];
String[] sTempBookingDate=new String[1250];
String[] sTempTime=new String[1250];
Integer[] iTempAdult=new Integer[1250];
Integer[] iTempChildren=new Integer[1250];
Integer[] iTempInfant=new Integer[1250];
Integer[] iTempPrice=new Integer[1250];

try
{
//read from data
Save2 save1;
ObjectInputStream OIS1 = new ObjectInputStream(new
FileInputStream("save2"));
do
{
save1 = (Save2)OIS1.readObject();
sTempFrom[iCount] = save1.sFrom;
sTempTo[iCount] = save1.sTo;
sTempClass[iCount] = save1.sClass;
sTempBookingDate[iCount] = save1.sBookingDate;
sTempTime[iCount] = save1.sTime;
iTempAdult[iCount] = save1.iAdult;
iTempChildren[iCount] = save1.iChildren;
iTempInfant[iCount] = save1.iInfant;
iTempPrice[iCount] = save1.iPrice;

iCount++;
if(save1.sBookingDate.equals(sBookingDate))
if(save1.sTo.equals(sTo))
iSeatCount=iSeatCount + save1.iAdult +
save1.iChildren + save1.iInfant;
}while(save1!=null);
OIS1.close();

}
catch(Exception e1)
{
}

iSeatCount = iSeatCount + iAdult + iChildren + iInfant;


if(iSeatCount > 60)
{
JOptionPane.showMessageDialog(null,"Seats are full. Sorry!");
}
else
{
int iChoice = JOptionPane.showConfirmDialog(null,"Seats available.
Do you want to Book now?");
if(iChoice == JOptionPane.YES_OPTION)
{
new PrintTicket1(sFrom, sTo, sClass, iAdult, iChildren,
iInfant, sBookingDate, iPrice, sTime);
try
{
//write into data
Save2 save2=new Save2(sFrom, sTo, sClass, iAdult, iChildren,
iInfant, sBookingDate, iPrice, sTime);
ObjectOutputStream OOS1 = new ObjectOutputStream(new
FileOutputStream("save2"));
for(i=0;i<iCount;i++)
{
Save2 temp1=new Save2(sTempFrom[i], sTempTo[i],
sTempClass[i], iTempAdult[i], iTempChildren[i], iTempInfant[i], sTempBookingDate[i],
iTempPrice[i], sTempTime[i]);
OOS1.writeObject(temp1);
System.out.println(temp1);
}
OOS1.writeObject(save2);
OOS1.close();
}catch(Exception e1)
{
System.out.println(e1);
}
}
else
{
}
}
}
}

class Save2 implements Serializable


{
String sFrom, sTo, sClass, sBookingDate, sTime;
Integer iPrice, iAdult, iChildren, iInfant;
// int iCount;
public Save2(String sFrom, String sTo, String sClass, Integer iAdult, Integer
iChildren, Integer iInfant, String sBookingDate, Integer iPrice, String sTime)
{
this.sFrom=sFrom;
this.sTo=sTo;
this.sClass=sClass;
this.iAdult=iAdult;
this.iChildren=iChildren;
this.iInfant=iInfant;
this.sBookingDate=sBookingDate;
this.iPrice=iPrice;
this.sTime=sTime;
// this.iCount = iCount;
}
public String toString()
{
return sFrom+" "+sTo+" "+sClass+" "+iAdult+" "+iChildren+" "+iInfant+"
"+sBookingDate+" "+iPrice+" "+sTime;
}
}
CONCLUSION

Developing this project is really a milestone of one educational curriculum. Once a particular
task is started, we can’t assure that we will get a successful result. But in that world there is no
problem without solution. We will reach the solution by analyzing the system again and again.

Understanding the functions and responsibilitites of the every user and how they are
proposed manually is a very boring task. The computerization of this process is an efficient way is a
challenging, but also interesting.
The entire task should be subjected to future modification. Because in this world every
minute why not every microsecond we get an improvement. This software has been developed in
such a manner that will be further modified by the user.
We tried our level best to incorporate almost all the transitions to a well established form.
Before to conclude this project, we can thank one and all who helped us to complete the project
successfully.
REFERENCES

For the successful completion of this project I referred few books.


I referred M.AWAD for creating ship diagram. Data flow diagram, structure chart etc.
I referred Ashok N. Kamthane while designing the interface of this project.
I also got information form Balagurusamy, Robert Lafore and Yashavant Kanetkar.

You might also like