You are on page 1of 31





Submitted to : Submitted By :
Mrs. Savita Saluja Name: Priyansh Kothari
I.P. Faculty Class: XII
Delhi Public School Section: C
This is to certify that Priyansh Kothari of Class XII successfully
completed the project work on MediQueue 1.0 for Class XII Practical
Examination of AISSCE
Informatics Practices in the year 2016-17.

_________________________ ____________________
Signature(Subject Teacher) Signature(Examiner)

I would like to acknowledge my gratitude to our principal

Mr. Sudarshan Sonar for his continous encouragement to all the
endeavours of his students.
It would be my utmost pleasure to express my sincere
thanks to my informatics practices teacher Mrs. Savita Saluja,
in providing a helping hand in the project. Without her
supervision, this project couldn't have attained its present form.
I would also like to take the opportunity to thank my
parents for extending their support and their constant
encouragement for my task.

Ms. Savita Saluja Mr. Sudarshan Sonar

I.P. Faculty Principal
Delhi Public School Delhi Public School
Indore Indore

Index Page No.

1. Introduction to Java 1
2. Steps to Run A Program 2
3. Language Structure 3
4. Interfaces 5
5. Variables & Methods 6
6. Modifiers 8
7. Statements 9
8. Loops 10
9. Arrays 11
10. Datatypes 12
11. Type Casting 13
12. Terminologies 14
13. MediQueue 15
14. MySQL 26
15. Bibliography 27
Introduction to Java
Java is a general-purpose computer programming
language that is concurrent, class-based, object-
oriented, and specifically designed to have as few
implementation dependencies as possible.

It is intended to let application developers "write

once, run anywhere" (WORA), meaning that
compiled Java code can run on all platforms that
support Java without the need for recompilation.

Java applications are typically compiled to

bytecode that can run on any Java virtual machine
(JVM) regardless of computer architecture.

As of 2017, Java is one of the most popular

programming languages in use, particularly for
client-server web applications, with a reported 9
million developers.

Java was originally developed by James Gosling at

Sun Microsystems (which has since been acquired by
Oracle Corporation) and released in 1995 as a core
component of Sun Microsystems' Java platform.

Steps to Run a Program
The following Java program is developed under
Linux using a text editor and the command line.

Save the source code in your javadir directory with

the filename. The name of a Java
source file must always equal the class name (within
the source code) and end with the .java extension. In
this example the filename must be,
because the class is called HelloWorld. Run it in the
command prompt and this is the output.

Language Structure
A class is a template that describes the data and
behavior associated with an instance of that class.
A class is defined by the class keyword and must
start with a capital letter.

An object is an instance of a class.The object is the
real element which has data and can perform
actions. Each object is created based on the class

Java groups classes into functional packages.
Packages are typically used to group classes into
logical units. Ex: java.util.*

Inheritance is the way a class inherits the behavior
and data definitions of another class. In this case
this class is called a subclass. Another common
phrase is that a class extends another class.
It is of 3 types: Single, Multilevel & Hierarchical.

In Java an exception is an event to indicate an
error during the runtime of an application.
So this disrupts the usual flow of the application's
In general exceptions are thrown up in the call
hierarchy until they get catched.

Showing of only essential properties and hiding
any background details. It is achieved in Java by
using interface and abstract class.

Interface is a type similar to a class and is defined
via the interface keyword.

Interfaces are used to define common behavior of

implementing classes.

If two classes implement the same interface, other

code which work on the interface level, can use
objects of both classes.

Like a class an interface defines methods. Classes

can implement one or several interfaces.

A class which implements an interface must

provide implementation for all abstract methods
defined in the interface.

An interface can have abstract methods and

default methods.

A default method is defined via the default

keyword at the beginning of the method signature.

Variables and Methods
Variables allow the Java program to store values
during the runtime of the program.

Instance Variable:
Instance variable is associated with an instance of
the class. Access works over these objects.

Local Variable:
Local /Stack variable declarations cannot have
access modifiers.

A method is a block of code with parameters and a
return value. It can be called on the object.

Main method:
A public static method with the following signature
can be used to start a Java application. Such a
method is typically called main method.

A class contains constructors that are invoked to
create objects based on the class definition.
Constructor declarations look like method
declarations except that they use the name of the
class and have no return type.
A class can have several constructors with different
Each class must define at least one constructor.

In the following example the constructor of the class

expects a parameter:-

There are three access modifiers keywords
available in Java: public, protected and private.

If something is declared public, e.g., classes or

methods can be freely created or called by other
Java objects.

If something is declared private, e.g., a method, it

can only be accessed within the class in which it is

A protected class can be accessed from the

package and sub-classes outside the package, while
a default class can get accessed only via the same

The if-else statement is a control flow statement.
A block of code is only executed when the test
specified by the if part evaluates to true.
The optional else block is executed when the if part
evaluates to false.
The switch statement can be used to handle several
alternatives if they are based on the same constant
Boolean Operations:
Used to compare two values and only offer a result
as true or false. Contains Short Circuit Methods
which means that they terminate once the result of
an evaluation is already clear

A for loop is a repetition control structure that
allows you to write a block of code which is executed
a specific number of times.

A while loop is a repetition control structure that
allows you to write a block of code which is executed
until a specific condition evaluates to false.

The do-while loop is similar to the while loop, with
the exception that the condition is checked after the

An array is a container object that holds a fixed
number of values of a single type.

An item in an array is called an element. Every

element can be accessed via an index.

The first element in an array is addressed via the 0

index, the second via 1, etc.

Datatypes are the entities that tell the compiler
that what variable will hold which kind of values.

Primitive Data Type:

These are the basic data types. They are pre-defined in
Java and hence primitive.

Reference Data Type:

These are non-primitive. They may be pre-defined or
user-defined. They store the data values with
reference to their address or location.

Type Casting
It is assigning a value of one data type to another
type either from lower precision to higher or vice
versa. It is of two types:-

Implicit Type Casting:

It is performed by the compiler without the user's
intervention. It takes place when the two types are
compatible and the target type is larger than the
source type. Known as 'Widening' casting.

Explicit Type Casting:

It is performed by the user which forces an
expression to be converted into another type. It is
done when assigning a larger type value to a variable
of smaller type. Known as 'Narrowing' casting.

Object Oriented Programming
Object Oriented means we organize our software as
a combination of different types of objects that
incorporates both data and behaviour in
programming in Java.

Keywords are the reserved words which convey a
special meaning to a language compiler. They can
not be used for any other purpose like function
name, variable name or object names.

These are statements which are ignored by the
Java compiler and increase the readability of a
program. These are used to state the purpose of
the code or methods used in a program.

Wrapper Class:
It is used to convert primitive data type into
reference data type and vice versa. It is of 8 types:-

MediQueue a GUI-based clinic queue management
JAVA software for medical clinics.

It enables a doctor and receptionist to efficiently

manage their clinics' daily operational needs.
Designed as a two-user integrated complementry
functioning program.
It uses MySQL as its Database Management Software
and is connected to the Java GUI via Java Database

Below is the code for its Main class.

It is secured by a Login Form, so It can't be accessed
by anyone outside the two-users.
It can be configured to the local host or any other IP
The Port, Database, User & Password can be
customized as per requirements.

Code: Connect Button

Code: Exit & Clear Button

It connects to MySQL with JDBC after verifying the

It displays 'Connection Established' in case the

credentials are correct or displays an error 'Invalid
Credentials' if they aren't.

This is mandated by catching an exception and

displays via a Dialog Box using JOptionPane.
The Reception panel is capable of adding new
patients and of removing them in case a patient leaves.

The Add panel has numerous fields, a combo box

and a button group for different entries.

Both are equipped with a Menu and Exit button and

the latter also has a Clear button.

The data is stored in a table in MySQL and can be

accessed via the Reception or Doctor panel.
It throws an Exception if a field is left blank.

It displays 'Successfully Registered' in case all

information is valid and no fields are left blank.

Code: Submit Button

The Remove button simply removes a patient when
a record is selected. The database entry is not deleted.

Once removed, a record if selected to be removed
will display an error.

Multiple entries can be done in this manner. There
is no limit except the capability of MySQL.
Now the Doctor's Panel has some more interesting
features suited to his needs.
It is a bit identical to the Receptionist's Panel. It
has some distict features.
It can mark an entry as 'Completed' which is then
also updated on the Receptionist's Panel via a
refresh mandated by Timer class in Java. A
separate button is not required and their is a time
delay of 10 sec between each refresh.


Code: Complete Button

If an entry is already removed from the Reception
Panel and is being completed in the Doctor's Panel,
then an error will be displayed.
It has an important role in managing the records. It
has the following structure:

It is the mediator in exchange of data. It stores the

Patient Name, Gender, Age, Visit Status, The
Referral Doctor, Token Assigned, Queue Date etc.

The following were utterly helpful in this project:

Saraswati Publications Informatics Practices Class

XII Textbook
Programming Simplified: