You are on page 1of 31

AISSCE INFORMATICS PRACTICES PROJECT 2016 -2017

DELHI PUBLIC SCHOOL


INDORE

"MEDIQUEUE"

Submitted to : Submitted By :
Mrs. Savita Saluja Name: Priyansh Kothari
I.P. Faculty Class: XII
Delhi Public School Section: C
Indore
CERTIFICATE OF COMPLETION
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(Principal)
Signature(Subject Teacher) Signature(Examiner)
ACKNOWLEDGEMENT

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
contents

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.

1
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 HelloWorld.java 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 HelloWorld.java,
because the class is called HelloWorld. Run it in the
command prompt and this is the output.

2
Language Structure
Class:
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.

Object:
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
definition.

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

Inheritance:
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.

3
Exceptions:
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
instructions.
In general exceptions are thrown up in the call
hierarchy until they get catched.

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

4
Interfaces
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.

5
Variables and Methods
Variable:
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.

Method:
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.

6
Constructor:
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
parameters.
Each class must define at least one constructor.

In the following example the constructor of the class


expects a parameter:-

7
Modifiers
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
declared.

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
package.

8
Statements
If-Else:
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.
Switch:
The switch statement can be used to handle several
alternatives if they are based on the same constant
value.
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

9
Loops
For-Loop:
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.

While-Loop:
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.

Do-While:
The do-while loop is similar to the while loop, with
the exception that the condition is checked after the
execution.

10
Arrays
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.

11
Datatypes
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.

12
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.

13
Terminologies
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:
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.

Comments:
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:-

14
MediQueue
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
Connection.

15
Below is the code for its Main class.
Code:

16
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
address/server.
The Port, Database, User & Password can be
customized as per requirements.

17
Code: Connect Button

Code: Exit & Clear Button

18
It connects to MySQL with JDBC after verifying the
credentials.

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.

19
Code: Submit Button

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

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

22
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.

23
Code:

24
Code: Complete Button

25
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.
MySQL
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.

26
Bibliography
The following were utterly helpful in this project:

Saraswati Publications Informatics Practices Class


XII Textbook
StackOverflow:
www.stackoverflow.com
Programming Simplified:
www.programmingsimplified.com
Javatpoint:
www.javatpoint.com
Google:
www.google.com

27