recruitment system

Document Sample
recruitment  system Powered By Docstoc
					                         1. PROBLEM DEFININGSTATEMENT

       Recruitment management system facilitates faster, unbiased, accurate and reliable
processing of applications from various applications. Helps to reduce the time-per-hire and cost-
per-hire. Recruitment system helps to incorporate and integrate the various links like the
application system on the official website of the company, the unsolicited applications,
recruitment, the final decision making to the main recruitment process. Recruitment        system
maintains an automated active database of the applicants facilitating the talent management and
increasing the efficiency of the recruitment processes.       Recruitment management system
provides and a flexible, automated and interactive interface between the online        application
system, the recruitment department of the company and the job seeker. Offers tolls and support
to enhance productivity, solutions and optimizing the recruitment processes to ensure improved
ROI. Recruitment management system helps to communicate and create healthy relationships
with the candidates through the entire recruitment process. The Recruitment        System is an
innovative information system tool which helps to sane the time and costs of the recruiters and
improving the recruitment processes

       The login module is used for security purpose. The administrator should enter their
username and password to go the database that consist the detail about the candidates and his
marks. The registration form module is used to get the details about the candidate, Such as the
name, address, mail-id and marks. The exam module is used to conduct the examination. the
initial step we want to authenticate the person so get the candidate verify and allow to the
exam. the exam type should be based on the company ,it has the questions and set of answers
with the defining time limit. Result module is used to show the result after conducting the
examination. this shows the candidate mark and       the total   mark and also whether he is
passed or not. The exam and the selection modules make the recruitment system as simple and
best. The selection module is used to select the candidate and give appointment to the particular
applicant with the help of the database we can able to know the details about the candidate and
also we can store the marks and the other important details. Then it is used maintain the track
record of the candidate. The main objective of this system is to reduce the complexity in the
selection of any organization and make easy and effective of the recruitment system.


                                               1
                             2. SOFTWARE REQUIREMENTS SPECIFICATION

1. Table of Contents
1.0. Purpose............................................................................................................................... 3
   1.1. Introduction .................................................................................................................... 3
   1.2. Scope .............................................................................................................................. 3
   1.3. References ...................................................................................................................... 4
   1.4. Document overview ........................................................................................................ 4
2.0. Overall description ............................................................................................................. 4
   2.1. System environment ....................................................................................................... 4
   2.2. Functional requirements definitions ............................................................................... 5
   2.3. Use cases......................................................................................................................... 5
           2.3.1. Use Case: Register applicant Details……………………………………….……5
           2.3.2. Use Case: Check Authentication……………………………….....……….…….6
           2.3.3. Use Case: View requirement details…………………………………………….6
           2.3.4. Use case: View examDetails……………………….……………………..….….6
           2.3.5. Use Case: PayforExam…………………………………………………….…....6
           2.3.6. Use Case: Conduct exam………………………………………………………..7
          2.3.7. Use Case: Show the result………………………………………………….…....7
   2.4. Non-functional requirements .......................................................................................... 7
3.0. Requirement specifications ................................................................................................ 8
   3.1. External interface specifications ..................................................................................... 8
   3.2. Functional Requirements ................................................................................................ 8
      3.2.1. Register applicant Details…………………………………………………..……….8
      3.2.2. CheckFor Authentication……………………………………………………….…...8
      3.2.3. View the requirement details……………………………………………….….……8
      3.2.4. ViewThe examDetails……………………………………………………….….…...9
      3.2.5. PayforExam…………………………………………………………………….……9
      3.2.6. Conduct exam……………………………………………………………...........…9
      3.2.7. Show the result…………………………………………………………………...….9
   3.3. Detailed non-functional requirements .................................................................. ……..9
   3.4. System Evolution ...................................................................... ………………………10



                                                                        2
1.0. Purpose

       1.1. Introduction

               The purpose of Software Requirements Specification (SRS) document is to
      describe the external behavior of the Recruitment System. Requirements Specification
      defines and describes the operations, interfaces, performance, and quality assurance
      requirements of the Recruitment System. The document also describes the nonfunctional
      requirements such as the user interfaces. It also describes the design constraints that are
      to be considered when the system is to be designed, and other factors necessary to
      provide a complete and comprehensive description of the requirements for the software.
      The Software Requirements Specification (SRS) captures the complete software
      requirements for the system, or a portion of the system. Requirements described in this
      document are derived from the Vision Document prepared for the Recruitment System.

      1.2. Scope
               The Software Requirements Specification captures all the requirements in a single
      document. The Recruitment System that is to be developed provides the company to
      select the members in the easy effective way. The Recruitment System is supposed to
      have the following features.
              The product provides both the applicant and the administrator should provide the
               Recruitment System is simple and best.
              The system provides logon facility to the administrators.
              The system provides the administrator only view the database.
              The database    should contain the details about the applicant. Such as the name,
               address, mail -id, and other details.
              The system should require to register the details about the applicant.so it
               should contain the registration form.
              The system allows the applicant to write the examination and view the results.
              The exam should contain the questions and also the objective type answers. The
               questions may be depends on the company.
                   The features that are described in this document are used in the future phases
          of the software development cycle. The features described here meet the needs of all


                                                  3
           the users. The success criteria for the system are based in the level up to which the
           features described in this document are implemented in the system.

       1.3. References
          1. [IEEE] The applicable IEEE standards are published in “IEEE Standards
             Collection,” 2001 edition.
          2. [Bruade] The principal source of textbook material is “Software Engineering: An
             Object-Oriented Perspective” by Eric J. Bruade (Wiley 2001).
          3. [Reaves SPMP] “Software Project Management Plan recruitment System Web
             Accessible Passenger Database.”

       1.4. Document overview
              The remainder of this document is two chapters, the first providing a full
       description of the project for the owners of the ORRS. It lists all the functions performed
       by the system. The final chapter concerns details of each of the system functions and
       actions in full for the software developers‟ assistance. These two sections are cross-
       referenced by topic; to increase understanding by both groups involved.


2.0. Overall description
       The Recruitment System is a package to be used by company or any organizations. The
organization or company improves the efficiency of selecting the candidate to his companies.
The Recruitment System to be developed benefits greatly the administration and the applicant.

       2.1. System environment:
              Software Requirement
                      Operating System -: Window XP
                      Database            -: MicrosoftAccess2007
                      Language            -: JAVA 2.0
                      Web Server          -: Apache
              Hardware Requirement
                         512 RAM, Pentium P3/P4, 20/40 GB Hard disk




                                                  4
2.2. Functional requirements definitions
       Functional Requirements are those that refer to the functionality of the system,
i.e., what services it will provide to the user. Nonfunctional (supplementary)
requirements pertain to other information needed to produce the correct system and are
detailed separately.

2.3. Use cases
       Use cases are text stories, widely used to discover and record requirements. They
emphasize the user goals and perspective. The use case name starts with verb.
       The use cases used in this system are
           Register applicant Details
           Check Authentication
           View recruitment details
           View examDetails
           PayExam
           Conduct exam
           Show result
           Issue Appoinment


       2.3.1. Use Case: Register applicant Details
           Brief Description:
                 The RegisterApplicantDetails use case is accesed by the Applicant which
           is used to register his/her details.
           Initial step-by-step description:
                 For this use case to be initiated, the applicant enter into the recruitment
            system.
                 1 The applicant read the job requirements of the to the recruitment system.
                 2   The applicant selects the job and accepts the rules and regulations.
                 3   To fill the registration form and give submit.




                                            5
2.3.2. Use Case: CheckFor Authentication
      Brief Description:
              The CheckFor Authentication use case verifies the entered user
      name and password with the database.The viewthe requirement details
      use case is used to specify     the company requirement.
      Initial step-by-step description:
              For this use case to be initiated the Passenger must be connected to
      the Internet and on the ORRS Entries page.
          1   The applicant enters his/her username.
          2   The applicant then enters his/her password.
          3   The applicant clicks login.
          4   The applicant enters to the recruitment system.


2.3.3. Use Case: View the requirement details
      Brief Description:
                The applicant to view requirement details of the recruitment
      system.
      Initial step-by-step description:
              For this use case to be initiated the applicant must be enter into the
      system.
      1. The applicant should choose the job from the vacancies.
      2. The applicant should accept the conditions.
2.3.4. Use Case: ViewThe examDetails
      Brief Description:
              The applicant to view the exam details and exam fee details.
      Initial step-by-step description:
              For this use case to be initiated the applicant must be connected to
      the system.
              1. The applicant should view the exam details.
              2. The applicant should pay the exam fee.




                                 6
       2.3.5. Use Case: Pay Exam
               Brief description:
                      The applicant should pay his/her exam fee.
               Initial step-by-step description:
                      For this use case to be initiated the applicant must be connected to
               the system.
                      1. The applicant should enter the examination number for the
               authentication.
                      2. The applicant should pay his/her exam fee.


        2.3.6. Use Case: Conduct exam
               Brief description:
                       The administrator should conduct the examination.
               Initial step-by-step description:
                      For this use case to be initiated the administrator must be
               connected to the system.


       2.3.7. Use Case: Show result
               Brief description:
                       The administrator should start this usecase.
               Initial step-by-step description:
                      For this use case to be initiated the administrator must be
               connected to the system. To display the result of the candidate‟s
               examination.

2.4. Non-functional requirements
       There are requirements that are not functional in nature. Specifically, these are the
constraints the system must work within. The web site must be compatible with both the
Netscape and Internet Explorer web browsers. This system will use the same type of
Internet security presently being used by recruitment system.




                                          7
3.0. Requirement specifications:

3.1. External interface specifications: None

3.2. Functional Requirements
          3.2.1. Register applicant Details
Use Case Name:              Register applicant Details
Priority                    Essential
Trigger                     Menu selection
Precondition                Applicant is connected to the system.
Basic Path                  The applicant should enter into the system.
Alternate Path              N/A
Post condition              The applicants on the Recruitment system.
Exception Path              If there is a connection failure the recruitment Server returns to the
                            wait state.


          3.2.2. CheckFor Authentication
Use Case Name:              CheckFor Authentication
Priority                    Essential
Trigger                     Selects
Precondition                The applicant is connected to the system.
Basic Path                  The applicant should enter his/her name and college details with
                                the marks.
Alternate Path              N/A
Post condition              The registration record is created in the login Table of the
                            applicant Database.
Exception Path              If there is a connection failure the recruitment Server returns to the
                            wait state.




                                                  8
          3.2.3 .View The examDetails
Use Case Name:               ViewThe examDetails
Priority                     Essential
Trigger                      Menu selection
Precondition                 Passenger is connected to the system.
Basic Path                   1. The applicant should enter the username.
                             2. The applicant should then enter the password.
Alternate Path               N/A
Post condition               The applicant to view the exam details and accept the
                             conditions.
Exception Path               If there is a connection failure the recruitment Server returns to the
                             wait state.


          3.2.4. Pay Exam
Use Case Name:              Pay Exam
Priority                    If time permits.
Trigger                     Menu selection
Precondition                Applicant is connected to the system and already registers the exam.
Basic Path                  The applicant may already register the exam.
Alternate Path              N/A
Post condition              The applicant should allowed to write the examination.
Exception Path              If there is a connection failure the recruitment Server returns to the
                            wait state.


          3.2.5.Conduct examination
Use Case Name:               Conduct Exam
Priority                     If time permits.
Trigger                      Menu selection
Precondition                 Applicant is connected to the system and already register the




                                                   9
                            exam.
Basic Path                  The applicant may already register the exam.
Alternate Path              N/A
Post condition              The applicant should appear the examination.
Exception Path              If there is a connection failure the recruitment Server returns to the
                            wait state.


          3.2.6. Show the result
Use Case Name:              Show the result.

Priority                    If time permits.

Trigger                     Menu selection

Precondition                Applicant is connected to the system and already write the exam.

Basic Path                  The applicant may already write the exam.

Alternate Path              N/A

Post condition              The applicant should view the examination result.

Exception Path              If there is a connection failure the recruitment Server returns to the
                            wait state.

3.3. Detailed non-functional requirements

Attribute Name             Attribute Type      Attribute Size
FirstName*#                String              30
LastName*#                 String              30
Gender*#                   String              30
Date of Birth*#            String              50
Resident Address*#         String              50
Profession*#               String              30
Phone number*#             String              15
e-mail ID*#                String              30
Account number*#           String              15
D/C Card number*#          String              15
Username*^                 String              30
Password*^                 String              50
Train no.#                 String              5
Source*#                   String              20
Destination*#              String              20
No.ofAvailable seats*#     String              10


                                                  10
       Fields marked with an „*‟ are required fields. Fields marked with a „#‟ can be visible or
not visible and is determined by the Passenger. Fields marked with a „^‟ are never visible to
anyone other than the Passenger.


Hardware              : - recruitment Server
Operation System        :-Window 98 or above
Internet Connection   :-Existing telephone lines
Performance           :-The system should generate the records in the appropriate table of the a
                      Database applicant 100% of the time.

3.4. System Evolution
       In the future this system will be update to allow students from the Computer Masters
Program to join. If time does not permit the search/e-mail section can be done, possibly by
another Master Studio student. A report generated by the system of the responses to the survey
could be another addition to the ORRS in the future.




                                               11
             3. IDENTIFY USE CASES AND DEVELOP USE CASE MODEL


3.1:Use cases
        A use case describes a sequence of actions that provide something of measurable value
to an actor and is drawn as a horizontal ellipse. Use cases are text stories, widely used to discover
and record requirements.The main purpose of a use case diagram is to show what system
functions are performed for which actor. Roles of the actors in the system can be depicted


3.2: Use case model& use case diagram:
       Use case model provides an external view of the system or application ditected
towards the user or the actor of the system. Use case model express what the business or
application will do.Use case model is the set of all written use cases;it is a model of the
system‟s functionality and environment.Use case diagaram is a graph of actors,a set of
usecases enclosed by a system boundary,communication associations between the actors and
the use cases and generalization among the use cases.


       3.2.1: Actors& scenario
                An actor anything with behaviour,including the system under discussion itself
       when it calls upon the services of other system. Example object , place, person or
       anything.


                Types:
                There are four types of actors in the UML, which are as follows:
                 Primary actor:  It uses a system‟s primary functions.
                 Secondary actor: It uses a system‟s secondary functions.
                 Active actor: It initiates the Use-Case.
                 Passive actor: It only participates in one or more Use-Cases.


                A scenario is the specific sequence of action and interactions between actors
       and the system. It is also called as the usecase instance.




                                                 12
       3.2.2:USE CASE SYMBOLS:




3.3:IDENTIFY THE USE CASES:
       The use cases involved in recruitment system are,
                  Register applicant Details
                  Check Authentication
                  View requirement details
                  View examDetails
                  PayExam
                  Conduct exam
                  Show result
                  Issue Appoinment
       The RegisterApplicantDetails use case is accesed by the Applicant which is used to
register his/her details.The CheckFor Authentication use case verifies the entered user name and
password with the database.
       The ViewTheTrainDetails use case specify the train name and train number for the
specified source and destination.The Exam detail use case allows the Applicant tom saw and
accept the exam details.The CheckAvailaility OfSeatsuse case can be used to view the
vacancy position of the company or the organization.The PayForExam use case allows the
Applicant to pay for the Examination.
       The conductExam usecase is used to conduct the exam on the administrator or the
organization   based.The Showresult       usecase    is   used   to   display   results   of   the
examination.The IssueAppoinment use case provides Appoinment to the Applicant.



                                                13
3.3usecase diagram for recruitment system:




                                         Read the ad




                                      Entering the details




                                      show exam details




                                         Accept the rule




                                          pay    the fee
       Applicant



                                         Conduct     exam




                                         Show the reslult



                                                                <<include>>


                                          e
                                       Giv the Appoinment




                                              Edit   details
         Admin




                                        Answer the Question




                                             Filter applicant




                                                Show result




                                              14
                           4. UML ACTIVITY DIAGRAM
4.1 Business object modeling
      The UML activity diagram is used to visualize workflows and business processes.
4.2Activity diagram
      The activity diagram is used to represent the dynamic view of the systems .a uml
activity diagram shows sequential and parallel activities in a process .they are useful for
modeling business process, workflow, data flow, and complex algorithms.
      The activities involved in the recruitment system are,
             1. Register Applicant Details - The Register Applicant Details activities are
      performed by the Applicant.to insert the details.
             2.ValidateApplicant - The Validate the Applicant activities are performed by the
      administrator to   validate   the   candidate .Pay examination - The Pay examination
      activities are performed by the Applicant.to pay the exam fee for the entrance exam.
             3. Authorization Transaction. - The Authorization &Transaction activities are
      performed by the payment.to validate the applicant and his account details. The Get the
      fee activities are performed by the administrator to     get the fee from the candidate and
      allow his to the exam.
             4.Get fee – the get fee activities are performed by the administrator.to get the
      payment of fee to the examination.
             5.ConductExam - The Conduct Exam fees activities are performed by the
      administrator to conduct the exam and to update the marks and details.
             6.Issue Appoinment - The Issue Appointment activities are performed by the
      administrator to give the appointment orders to the exam passed candidates.
      4.2.1:Activity diagram UML notations:




                                              15
4.3 Activity diagram for Recruitment System:




       Applicant
                                     Recruitment    system   payment




         Edit the                         Validate the
          details                           Applicant




                                          Request to
                                          pay the fee




                                                             Authorization
                                                             &Transaction




                                           get fee &
                                              allow




                                         Conduct Exam




                                          Display result




             Get
          Appoinment




           Exit the
           System




                                               16
5. IDENTIFY CONCEPTUAL CLASS AND DOMAIN MODEL DIAGRAMS
5.1: Domain model
       Domain model is a visual representation of conceptual classes or real situation objects in
a domain. Domain model is also called as conceptual model, domain object model and analysis
object model.

        A UML domain model will relate objects in the system domain to each other. It will
define concepts and terms. Objects in the domain model can be:

      Physical objects
      Abstract concepts

       5.1.1: Domain model a Picture of Software Business Objects
                  A UP domain model is a visualization of things in a real situation domain of
       interest, not of software objects, or software objects with responsibilities.


       5.1.2: Domain model a Visual Dictionary
                  Domain model visualizes and relates words or concepts in the domain. Therefore,
       the domain model is a visual dictionary of the remarkable abstractions, domain
       vocabulary and information content of the domain.
5.2 Guideline to create domain model


       5.2.1: Finding conceptual classes
       There are three strategies are followed to find the conceptual classes. They are,
                 Reuse or modify existing models
                 Use a category list


Category list                                example
Transaction                                  payment
Role of people or organization               Student, college, department
Records of frame                             register
Container                                    recruitment




                                                 17
            Identify noun phrases
                         i. College
                     ii. Department
                    iii. Student
                    iv. Result
                     v. Recruitment
                    vi. Interview
                   vii. Exam
                           The conceptual sub classes can be found by using the following rules,
            100 % rule
            Is a rule


      5.2.2:Domain model diagram symbols


                NewClass         Class symbol


                                      Association line


5.3 Domain model diagram for Recruitment System:




                                                18
                               6. INTERACTION DIAGRAM
6.1 Sequence diagram
      6.1.1 Definition
             Sequence diagram illustrates the interaction in a kind of fence format, in which
      each new object is added to the right side.
       Symbols




6.1.2 Sequence diagram for Recruitment System




        Candidate                              Recruitment                Payment/Authorization
                                                 System

                     Read Msg&Instruction


                           Enter Deatails




                    Validate The Candidate



                     Request to Pay Fee



                         Give Credit Details


                                                              Verify Credit



                                                             Reply Payment



                          Conduct Exam


                         Select Candidate




                          Get Appoinment




                                                  19
6.2 Collaboration diagram
      6.2.1 Definition
                The collaboration of communication diagram illustrates the object interaction in a
      graph or network format, in which objects can be placed anywhere on the diagram.
      6.2.2 Symbol

                                                          Life Line box



      6.2.3 UML Collaboration diagram for recruitment System



                         1: Read the vacancy and Rules
                         2: Enter the applicant details
                          3: Validate the Applicant
                          4: Request to pay fee
                          5: Give the credit details
                         8: Conduct examination
       :Applicant        9: Write the examination                         :RecruitmentSystem

                          10: Evaluate the Applicant


                          11: Give Appointmentorder
                                                                                     6: Verify the credit card information

                                                                                     7: Reply




                                                                      :PaymentAuthorization




                                                            20
                               7. STATE CHART DIAGRAM
7.1 Definition:

       The state chart diagram is used to model the behavior of the system. The uml includes
notation to illustrate the events and states of things-transactions, use cases, people, and so forth.


       State chart diagram describes the flow of control from one state to another state. States
are defined as a condition in which an object exists and it changes when some event is triggered.
So the most important purpose of State chart diagram is to model life time of an object from
creation to termination.

       Following are the main purposes of using State chart diagrams:

              To model dynamic aspect of a system.
              To model life time of a reactive system.
              To describe different states of an object during its life time.
              Define a state machine to model states of an object.

       The objects are generally in two types as follows,
              State-dependent-with respect to that event.
              State-independently-an object reacts the same way.
       Transition:
               The transition can cause an action fire.in software implementation, this may
       represent the invocation of method of the class of the state diagram.
               The states involved in the recruitment system as follows:
              Initial state
              Registration
              Payment
              Permission
              Exam
              Result
              Filtering
              Appointment



                                                  21
7.2 UML Symbol:




7.3 UML State Chart Diagram for recruitment System



           Read



       Initaial
        State



    Accept Instructions

                                                 Exam
      Registratio
          n
                               Payment                             Result


                                 Money
          Write Exam                                         Result Display

                              Permission         Permission        Exam




                                                    Filter

                                                Filtering




        Appoinment

                                  Select

                  Exit




:




                                           22
                    8. LOGICAL ARCHITECTURE DIAGRAM
8.1 Logical Architecture Definition
       The logical architecture is the large-scale organization of the software classes into
packages (or namespaces), subsystems, and layers. It‟s called logical architecture because there‟s
no decision about how these elements are deployed across different operating system processes
or across physical computers in a network.


8.2 Layers of Logical Architecture Explanation


       User Interface Layer:
               This layer which provides Graphical User Interface (GUI) objects such as forms
       and frames for communicating with the users through their needs and requirements.


       Application Logic and Domain Object:
               Software objects representing domain concepts (for example, a software class
       sale) that fulfill application requirements, such as calculating a sale total.


       Technical Services:
               General purpose objects and subsystems that provide supporting technical
       services, such as interfacing with a database or error logging. These services are usually
       application-independent and reusable across several systems.


     8.3 Logical Architecture diagram symbols




       Package symbol




                                                 23
8.4 Logical Architecture diagram:




                                    24
    9. IMPLEMENTATION UI, APPLICATION LOGIC AND TECHNICAL SERVICE
                                         LAYERS
menu.java:
import javax.swing.table.*;
import java.util.*;
import java.io.*;
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import javax.swing.*;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class menu extends Frame implements WindowListener,ActionListener
{
MenuBar mb;
MenuItem student,rollnowise,namewise,allresult;
public static menu m;


                                             25
registration rw;
login1 lo;
Quiz e;
int x,y,d;
public menu()
 {
super("RECRUITMENT SYSTEM");
addWindowListener(this);
 x=y=700;
 d=10;
setSize(x,y);
setBackground(Color.gray);
addMenu();
show();
 }
public static void main(String args[])
 {
    m=new menu();
 }
void addMenu()
{
MenuBar mb=new MenuBar();
Menu register=new Menu("ADMINISTRATOR");
Menu inquery=new Menu("APPLICANT");
register.add("LOGIN");
register.add("EXIT");
inquery.add("REGISTRATION");
inquery.add("EXAM");
inquery.add("EXIT");
Label l=new Label (" Company:SAS");
Label i=new Label("JOB:Java Programmer");



                                            26
Label i1=new Label("Qualification:Degree(B.Tech,M.Tech)");
Panel des=new Panel(new GridLayout(1,2));
des.add(l);
des.add(i);
des.add(i1);
add(des);
mb.add(register);
mb.add(inquery);
setMenuBar(mb);
register.addActionListener(this);
inquery.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String arg=ae.getActionCommand();
if(ae.getSource() instanceof Menu)
if(arg.equals("EXIT"))
        {
System.exit(0);
        }
if(ae.getSource() instanceof Menu)
if("REGISTRATION".equals(arg))
    {
rw=new registration();
rw.show();
    }
if(ae.getSource() instanceof Menu)
if("LOGIN".equals(arg))
    {
lo=new login1();
lo.show();



                                              27
     }
if(ae.getSource() instanceof Menu)
         if("EXAM".equals(arg))
             {
                 e=new Quiz();
         e.show();
             }
 }
public void windowClosed(WindowEvent we){}
public void windowDeiconified(WindowEvent we){}
public void windowIconified(WindowEvent we){}
public void windowActivated(WindowEvent we){}
public void windowDeactivated(WindowEvent we){}
public void windowOpened(WindowEvent we){}
public void windowClosing(WindowEvent we)
{
while(x>0 && y>0)
 {
setSize(x,y);
    x=x-d;
    y=y-d;
show();
 }
System.out.println("ERROR");
dispose();
System.exit(0);
}}
//class for name wise report


class NextPage extends JFrame
     {



                                            28
NextPage()
       {
setDefaultCloseOperation(javax.swing.
               WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Welcome");
setSize(400, 200);
           }
   }
//login test
class login1 extends Frame implements ActionListener,WindowListener
  {
public static login1 lo;
  TextField tf_name=new TextField(20);
  JTextField tf_passw=new JPasswordField(14);
  Label l2=new Label("PASSWORD");
  Label l1=new Label("NAME");
  Button but_submit=new Button("SUBMIT");
  Button but_cancel=new Button("CANCEL");
  Button ok=new Button("OK");
  Dialog dlg;
  Label msg;
int x,y,d;
public login1()
  {
super("LOGIN FROM");
addWindowListener(this);
setLayout(new GridLayout(6,1));
setBackground(Color.YELLOW);
setVisible(true);
addmenu();
  x=550;



                                            29
  y=450;
  d=12;
setSize(x,y);
show();
  }
void addmenu()
  {
  //GridLayout gl=new GridLayout();
  Panel p1=new Panel(new GridLayout(1,2));
p1.add(l1);
p1.add(tf_name);
Panel p2=new Panel(new GridLayout(1,2));
p2.add(l2);
p2.add(tf_passw);
  Panel p3=new Panel();
p3.add(but_submit);
p3.add(but_cancel);


add(p1);
add(p2);
add(p3);
  but_submit.addActionListener(this);
  but_cancel.addActionListener(this);
ok.addActionListener(this);
  //Dialog for confirmation
       dlg=new Dialog(this,"recuritment System",false);
       dlg.setLayout(new GridLayout(2,1));
       dlg.setSize(100,100);
       dlg.setLocation(200,100);
       ok.setSize(50,50);
       msg=new Label("login successfully");



                                              30
       dlg.add(msg);
       dlg.add(ok);
  }
public void actionPerformed(ActionEvent e)
  {
  String arg=e.getActionCommand();
  //SUBMITBUTTON
if(e.getSource() instanceof Button)
if("SUBMIT".equals(arg))
        {
        String value1=tf_name.getText();


   String value2=tf_passw.getText();
if (value1.equals("apec") && value2.equals("apec")) {
        Vector columnNames = new Vector();
        Vector data = new Vector();
        JPanel p=new JPanel();
       try {
       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection con = DriverManager.getConnection("jdbc:odbc:student1");
        String sql = "Select * from register";
        Statement stmt = con.createStatement();
        ResultSet rs = stmt.executeQuery( sql );
        ResultSetMetaData md = rs.getMetaData();
       int columns = md.getColumnCount();
       for (int i = 1; i <= columns; i++) {
       columnNames.addElement( md.getColumnName(i) );
        }
       while (rs.next()) {
        Vector row = new Vector(columns);
       for (int i = 1; i <= columns; i++){



                                                 31
       row.addElement( rs.getObject(i) ); }
       data.addElement( row ); }
       rs.close();
       stmt.close(); }
       catch(Exception se){
       System.out.println(se); }
          JTable table = new JTable(data, columnNames);
          TableColumn col;
       for (int i = 0; i < table.getColumnCount(); i++) {
       col = table.getColumnModel().getColumn(i);
       col.setMaxWidth(500); }
          JScrollPane scrollPane = new JScrollPane( table );
       p.add( scrollPane );
          JFrame f=new JFrame();
       f.add(p);
       f.setSize(600,400);
       f.setVisible(true);


          /* NextPage page=new NextPage();
page.setVisible(true);
   JLabel label = new JLabel("Welcome:"+value1);
page.getContentPane().add(label);*/


     }}
  //OK button


       if ( e.getSource() instanceof Button)
if ("OK".equals(arg))
{ dlg.dispose();
       }
   //CANCEL



                                                32
if(e.getSource() instanceof Button)
if("CANCEL".equals(arg))
            {
            tf_name.setText("");
            tf_passw.setText("");


            }
}
public void windowClosed(WindowEvent we){}
public void windowDeiconified(WindowEvent we){}
public void windowIconified(WindowEvent we){}
public void windowActivated(WindowEvent we){}
public void windowDeactivated(WindowEvent we){}
public void windowOpened(WindowEvent we){}
public void windowClosing(WindowEvent we)
        {
while(x>0 && y>0)
        {
setSize(x,y);
        x=x-d;
        y=y-d;
show();}
dispose();
        }}
//registration test
class registration extends Frame implements ActionListener,WindowListener
    {
public static registration re;
    TextField tf_name=new TextField(20);
    TextField tf_age=new TextField(20);
    TextField tf_gender=new TextField(20);



                                             33
  TextField tf_quali=new TextField(20);
  TextField tf_college=new TextField(20);
  TextField tf_percentage=new TextField(20);
  TextField tf_emailid=new TextField(20);
  TextField tf_conductno=new TextField(20);
  TextField tf_dob=new TextField(20);
  Label l2=new Label("DOB");
  Label l1=new Label("NAME");
  Label l3=new Label("AGE");
  Label l4=new Label("COLLEGE");
  Label l5=new Label("DEGREE");
  Label l6=new Label("MARK(CGPA)");
  Label l7=new Label("GENDER");
  Label l8=new Label("PHONENO");
  Label l9=new Label("EMAILID");
  Button but_register=new Button("REGISTER");
  Button but_cancel=new Button("CANCEL");
  Button ok=new Button("OK");
  Dialog dlg;
  Label msg;
int x,y,d;
public registration()
  {
super("REGISTERATION ");
addWindowListener(this);
setLayout(new GridLayout(10,2));
setBackground(Color.yellow);
setVisible(true);
addmenu();
  x=450;
  y=350;



                                               34
  d=12;
setSize(x,y);
show();
  }
void addmenu()
  {
  GridLayout gl=new GridLayout();
  Panel p1=new Panel(new GridLayout(1,2));
p1.add(l1);
p1.add(tf_name);
Panel p2=new Panel(new GridLayout(1,2));
p2.add(l2);
p2.add(tf_dob);
Panel p3=new Panel(new GridLayout(1,2));
p3.add(l3);
p3.add(tf_age);
  Panel p4=new Panel(new GridLayout(1,2));
p4.add(l4);
p4.add(tf_college);
  Panel p5=new Panel(new GridLayout(1,2));
p5.add(l5);
p5.add(tf_quali);
  Panel p6=new Panel(new GridLayout(1,2));
p6.add(l6);
p6.add(tf_percentage);
  Panel p7=new Panel(new GridLayout(1,2));
p7.add(l7);
p7.add(tf_gender);
  Panel p8=new Panel(new GridLayout(1,2));
p8.add(l8);
p8.add(tf_conductno);



                                             35
  Panel p9=new Panel(new GridLayout(1,2));
p9.add(l9);
p9.add(tf_emailid);
  Panel p10=new Panel(new GridLayout(1,2));
p10.add(but_register);
p10.add(but_cancel);
add(p1);
add(p2);
add(p3);
add(p4);
add(p5);
add(p6);
add(p7);
add(p8);
add(p9);
add(p10);
  but_register.addActionListener(this);
  but_cancel.addActionListener(this);
ok.addActionListener(this);
  //Dialog for confirmation
       dlg=new Dialog(this,"Inventory Management System",false);
       dlg.setLayout(new GridLayout(2,1));
       dlg.setSize(100,100);
       dlg.setLocation(200,100);
       ok.setSize(50,50);
       msg=new Label("Record Updated");
       dlg.add(msg);
       dlg.add(ok);
  }
public void actionPerformed(ActionEvent e)
  {



                                             36
      String arg=e.getActionCommand();
      //ADDBUTTON
if(e.getSource() instanceof Button)
if("REGISTER".equals(arg))


                           try {String n="NOTELIGIBLE";
                                 // Load Jdbc Odbc Driver
                                 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                                 Connection con = DriverManager
                                               .getConnection("jdbc:odbc:student1");


String                                             sql                                          =
“insertintoregister(NAME,DOB,AGE,COLLEGE,QUALIFICATION,PERCENTAGE,GENDE
R,CONDUCT,EMAILID,RESULT)values('"+tf_name.getText()
+"','"+tf_dob.getText()+"',"+tf_age.getText()+",'"+tf_college.getText()+"','"+tf_quali.getText()+"
',"
+tf_percentage.getText()+",'"+tf_gender.getText()+"',"+tf_conductno.getText()+",'"+tf_emailid.
getText()+"','"+n+"')";
      Statement st = con.createStatement();
st.execute(sql);
JOptionPane.showMessageDialog(null, "Record Added Succesfully.",
                                        "Record                                          Added",
JOptionPane.INFORMATION_MESSAGE);
      //clearControls();
      }
catch (Exception se) {
JOptionPane.showMessageDialog(null,se.getMessage(), "Error",
                                               JOptionPane.ERROR_MESSAGE);
                           }
      //OK button
if ( e.getSource() instanceof Button)



                                                  37
if ("OK".equals(arg))
{ dlg.dispose();
           }
   //CANCEL
if(e.getSource() instanceof Button)
if("CANCEL".equals(arg))
       {
       tf_name.setText("");
       tf_dob.setText("");
       tf_college.setText("");
       tf_age.setText("");
       tf_quali.setText("");
       tf_percentage.setText("");
       tf_gender.setText("");
       tf_conductno.setText("");
           tf_emailid.setText("");
       }}
public void windowClosed(WindowEvent we){}
public void windowDeiconified(WindowEvent we){}
public void windowIconified(WindowEvent we){}
public void windowActivated(WindowEvent we){}
public void windowDeactivated(WindowEvent we){}
public void windowOpened(WindowEvent we){}
public void windowClosing(WindowEvent we)
   {
while(x>0 && y>0)
   {
setSize(x,y);
   x=x-d;
   y=y-d;
show();



                                            38
      }
dispose();
     }}


Quiz.java:
import java.awt. *;
import java.awt. event.*;
import java.sql.*;
import javax.swing.*;
/**
** <big><b>Description: Quiz program for students. </b></big><p>
** Questions are set from Writer.java and data is obtained from
** QuestionData.java (as written by Writer.java), the number of
** questions, pass mark is flexible. Quiz.java has one main GUI
** panel, plus a second frame is used with the results after the
** test is completed.<p>
** @author Simon Scott email: scotties9@hotmail.com
** @version 1.02: 5th July 2003
*/


public class Quiz extends JFrame{
static String name ="";
static int TOTAL=0;
     String n="ELIGIBLE";
     String m="NOTELIGIBLE";
/**
** static inner modifier checks to see questions have been written. <br>
** If no questions are written the program will exit with a JOptionPane message <br>
** The method gets the student name and will provide the name " noname.java" if none is
entered
**        The method also adds a space so that the first name can be isolated



                                                  39
**     @throws NullPointerException
**/
       static{
                 try{
                        TOTAL = QuestionData.tally;
if(TOTAL==0){


       JOptionPane.showMessageDialog(null,"<html>QuestionData.java   has   no   questions,
please use the<br>"+" program 'Writer' to create a new set of questions</html>"," PROGRAM
WILL EXIT:",JOptionPane.INFORMATION_MESSAGE);
       System.exit(0);
       }
else name = JOptionPane.showInputDialog("Enter your name below");
if(name.length() < 1) name = " noname.java";
else name = name.trim() + " ";
}
catch(NullPointerException e){ System.exit(0); }
}
int seconds, minutes, qCount, itemCheck, mark;
final String TITLE = QuestionData.title;
final int LIMIT = QuestionData.timeLimit;
final int PASSMARK = QuestionData.passMark;
String []answers = new String[TOTAL];
JButton []butt = new JButton[8];
JTextArea answerTA[] = new JTextArea[4];
JCheckBox []boxes = new JCheckBox[4];
JTextPane pane = new JTextPane();
JLabel student, choose, message, timer, result, theQ;
boolean startTheTest, checkAnswers, allowRestart, finishAll;
PanelNorth panelNorth = new PanelNorth();
PanelSouth panelSouth = new PanelSouth();



                                               40
PanelCenter panelCenter = new PanelCenter();
/**
** Constructor initialises the sudent answers, adjusts the screen
** size to the window and adds the panels with a border layout.
**/
       protected Quiz(){
for (int i=0; i<TOTAL; i++) answers[i] ="";
                getContentPane().setLayout(new BorderLayout() );
                getContentPane().add("North", panelNorth);
                getContentPane().add("South", panelSouth);
                getContentPane().add("Center", panelCenter);
                int width = 0, height=0;
if(java.awt.Toolkit.getDefaultToolkit().getScreenSize().getWidth()<799){width=640;
height=460; }
else {width=720; height=540; }
                setSize(width,height);
                Dimension dim = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
                setLocation((dim.width-width)/2, (dim.height-height)/2);
       }


/**
** PanelNorth is BorderLayout north on the frame
** this mainly consists of information labels
**/
class PanelNorth extends JPanel{


/**
** PanelNorth constructor acts as a 'header'
**     the label 'message' keeps a track of questions
** answered, still to do and displays warnings for instance the time left
**/



                                                41
public PanelNorth(){
               setLayout(new GridLayout(2,2));
               student = new JLabel(" Student: "+name+". Total questions: "+TOTAL);
               message = new JLabel();
               message.setForeground(Color.blue);
               add(student);
               add(message);
               add(new JLabel("              QUESTIONS") );
               add(new JLabel("              ANSWERS") );
setBorder(BorderFactory.createEtchedBorder() );
       }}


/**
** PanelSouth contains the control buttons
**/
class PanelSouth extends JPanel{
       public PanelSouth(){
               setBackground(new Color(230, 230, 255) );
               String       []labs      =    {"explain:","start:","previous:","next:","finish:","check
next:","check previous:","restart:"};
                        for(int i=0; i<butt.length; i++){
                                butt[i] = new JButton(labs[i]);
                                butt[i].addActionListener(new ActionHandler() );
                                if(i !=0)add(butt[i]);
                        }
setBorder(BorderFactory.createEtchedBorder() );
       }
}


/**
** PanelCenter contains all text areas (JTextPane and 4 JTextAreas) for the



                                                   42
** questions and the possible answers, it also ahs the answer buttons, the timer
** label and one other message label.
**/
class PanelCenter extends JPanel{


/**
** PanelCenter is has 3 other panels with a border layout.
** The 'North' panel has the time-keeper label. The 'West' panel
**      has the has the answer buttons and the 'Center' panel the answwer text areas
**/
       public PanelCenter(){
               setLayout(new GridLayout(1,2) );
               JScrollPane west = new JScrollPane(pane);
               pane.setFont(new Font ("monospaced",0,12) );
               pane.setText(QuestionData.info);
               pane.setEditable(false);
               JPanel east = new JPanel();
               east.setLayout(new BorderLayout() );
               JPanel northEast = new JPanel();
               northEast.setBackground(new Color(230, 230, 255) );
               east.add("North", northEast);
               JPanel westEast = new JPanel();
               westEast.setLayout(new GridLayout(6,1) );
               east.add("West", westEast);
               JPanel centerEast = new JPanel();
               centerEast.setLayout(new GridLayout(6,1) );
               centerEast.setBackground(new Color(255,255,200));
               east.add("Center", centerEast);
                      timer = new JLabel("       There are "+TOTAL+" questions in total");
                      timer.setFont(new Font ("Arial",Font.BOLD,16) );
                      timer.setForeground(new Color(0,90,20) );



                                                 43
                      northEast.add(timer);
                      theQ = new JLabel();
                      theQ.setFont(new Font("",Font.BOLD,16) );
westEast.add(theQ);
    String []boxs = {" A ", " B ", " C ", " D "};
                      for(int i=0; i<boxes.length; i++) {
                               boxes[i] = new JCheckBox(boxs[i]);
                               boxes[i].addItemListener(new ItemHandler() );
                               westEast.add(boxes[i]);
                      }
westEast.add(new JLabel() );
              choose = new JLabel("      CHOOSE CORRECT ANSWERS");
              choose.setBorder(BorderFactory.createEtchedBorder() );
              centerEast.add(choose);
    JScrollPane panes[] = new JScrollPane[4];
                      for(int i=0; i<answerTA.length; i++){
                               answerTA[i] = new JTextArea();
                      answerTA[i].setBorder(BorderFactory.createEtchedBorder() );
                               answerTA[i].setEditable(false);
                               answerTA[i].setBackground(Color.white);
                               answerTA[i].setFont(new Font("",0,12) );
       answerTA[i].setLineWrap(true);
answerTA[i].setWrapStyleWord(true);
panes[i] = new JScrollPane(answerTA[i]);
                      centerEast.add(panes[i]);
                      }
              if(LIMIT >0)result = new JLabel("              Time limit for this test: "+LIMIT+"
minutes");
              else result = new JLabel("      There is no time limit for this test");
              result.setBorder(BorderFactory.createEtchedBorder() );
              centerEast.add(result);



                                                 44
       add(west);
       add(east);
       }
}


/**
** ActionHandler handles all of the action events from the buttons. It also has
**     an inner class Timer which handles the Thread for the time limit and it has several of its
own methods
** @see Quiz.ActionHandler.Timer#run()
** @see Quiz.ActionHandler#checkStatus()
** @see Quiz.ActionHandler#getQuestion()
** @see Quiz.ActionHandler#recordAnswer()
** @see Quiz.ActionHandler#doAlert()
** @see Quiz.ActionHandler#endTest()
** @see Quiz.ActionHandler#colorTA()
** @see Quiz.ActionHandler#calculateResult()
**/
class ActionHandler implements ActionListener{


/**
** <b>The following actions are invoked:</b><p>
** "previous:" JButton event:<br>
** gets the previous question by decrementing the field int <p>
** "next:" JButton event:<br>
** gets the next question incrementing int qCount and
** will flag the boolean finishAll to allow the 'finish' button to be used
** when all questions have been cycled through<p>
** "finish:" JButton event:<br>
** gets the final result<p>
** "restart:" JButton event:<br>



                                                 45
** goes back to the start, reinitializes answers[]="" and restarts the Timer if the time is set<p>
**"check next:" JButton event:<br>
** gets the next question and correct answers after the test is completed <p>
** "check previous::" JButton event:<br>
** gets the previous question and correct answers after the test is completed<p>
**"explain:" JButton event:<br>
** gets the explanation text for the question after the test is complete from QuestionData.java
** @see Quiz.Results
** @see Quiz.ActionHandler#colorTA()
** @see Quiz.ActionHandler#colorTA()
**/
          public void actionPerformed(ActionEvent evt){
           String source = evt.getActionCommand();
                 if(source.equals("start:")){
                         butt[1].setVisible(false);
                         startTheTest=true;
                         allowRestart=true;
if(LIMIT >0)new Timer(); // inner Timer class thread
                         panelSouth.remove(butt[1]); //start
getQuestion();
      }
          if(startTheTest){
                 if(source.equals("previous:")) {
                         recordAnswer();
                         qCount--;
                 if(qCount == -1) qCount=TOTAL-1;
                         checkStatus();
getQuestion();
                 }
                 if(source.equals("next:")) {
                         recordAnswer();



                                                      46
                        qCount++;
                        if(qCount == TOTAL-1) finishAll=true;
                        if(qCount == TOTAL) qCount=0;
checkStatus();
getQuestion();
                 }
                 if(source.equals("finish:")) {
                        if (finishAll){
                                 recordAnswer();
                                 qCount = 0;
                                 butt[4].setBackground(Color.lightGray);
                                 timer.setForeground(Color.blue);
                                 timer.setFont(new Font ("Arial",0,14) );
                                 startTheTest=false;
                                 checkAnswers=true;
                                 panelSouth.add(butt[0]);
                                 colorTA();
                                 getQuestion();
                                 checkStatus();
                                 calculateResult();
                        }
else JOptionPane.showMessageDialog(null,"Cycle through all questions before pressing finish",
                                                                                      "User
Message",JOptionPane.INFORMATION_MESSAGE);
                 }
       } // startTheTest
       if(allowRestart){
if(source.equals("restart:")){
                        if(startTheTest)
                        seconds= minutes= qCount=0;
                        checkAnswers=false;



                                                   47
for(int i=0; i<TOTAL; i++) answers[i]="";
for(int i=0; i<boxes.length; i++) boxes[i].setSelected(false);
                         for(inti=0;i<answerTA.length;i++)
answerTA[i].setBackground(Color.white);
choose.setText(" CHOOSE ONE CORRECT ANSWER");
result.setText("      Time limit for this test: "+LIMIT+" minutes");
getQuestion();
startTheTest=true;
                         if(LIMIT >0){
                                 new Timer();
                 timer.setText(" Test restarted");
allowRestart=false;
                         }}}
       if (checkAnswers){
                 if(source.equals("check next:")) {
                         qCount++;
                         if(qCount == TOTAL) qCount=0;
                         colorTA();
                         getQuestion();
                         checkStatus();
                 }
                 if(source.equals("check previous:")) {
                         qCount--;
                         if(qCount == -1) qCount=TOTAL-1;
                         colorTA();
                         getQuestion();
                         checkStatus();
                 }
                 if(source.equals("explain:")){
       pane.setText(QuestionData.questions[qCount] + QuestionData.explain[qCount]);
                 }}



                                                  48
        validate();
        }
/**
** Timer implements the Runnable interface with the thread for the time
**
**/
class Timer extends Thread implements Runnable{
        public Timer(){
                 new Thread(this).start();
}
/**
** run method has Thread.sleep set at 1 second which is converted into minutes
** the run method is controlled by the boolean flag startTheTest
** @throws InterruptedException
**/
public void run() {
while(startTheTest){
try {
Thread.sleep(1000);
seconds++;
if(seconds % 60 == 0 && seconds != 0){
seconds -= 60;
minutes++;}
timer.setText(" TIMER: "+minutes+" mins : "+seconds+" secs ");
                                if(minutes==LIMIT){
                                        startTheTest=false;
                                        endTest();
            }
if((minutes==LIMIT-2)&&(seconds==0)) doAlert();
                   }
catch(InterruptedException ex) { System.out.print(ex); }



                                                 49
                }}}


/**
** Sets the buttons to false for the next question and will color the 'finish' button blue
**      if it is the last question. If the question has been answered already the the booloean
expression<pre>
**    if(answers[qCount].length() >0)</pre>
**      will be true and the data for the answer given by the user is recovered by setting
**      the selected checkbox answers to true
**/


    // All action methods methods listed seperately here in class ActionHandler
        public void checkStatus(){
                if((qCount == TOTAL-1)&&(startTheTest))butt[4].setBackground(Color.cyan);
                else butt[4].setBackground(Color.lightGray);
if(answers[qCount].length() >0){
                        for(int i=0; i<answers[qCount].length(); i++)
                        boxes[Integer.parseInt(answers[qCount].substring(i,i+1)                )-
1].setSelected(true);
                }
                else for(int i=0; i<boxes.length; i++)boxes[i].setSelected(false);
}


/**
** getQuestion keeps track of the question number and sets the text onto the text areas<br>
** It also informs the user how many questions are correct that is: 'choose 2 correct answers' is
shown
** in the main panel label. If the test is finished the labels are the same.
**/
        public void getQuestion(){
int j = qCount+1;



                                                  50
              theQ.setText(" Q"+j+":" );
              pane.setText(QuestionData.questions[qCount]);
              if(startTheTest)message.setText("Question "+j+" out of "+TOTAL);
for (int i=0; i<4; i++)answerTA[i].setText(QuestionData.answers[qCount][i]);
              if(startTheTest){
       String temp="";
                       if(QuestionData.n[qCount]==1)
temp="<html>&nbsp;&nbsp;&nbsp;CHOOSE                 THE         <b>ONE</b>             CORRECT
ANSWER</html>";
                       else                                      if(QuestionData.n[qCount]==2)
temp="<html>&nbsp;&nbsp;CHOOSE THE <b>TWO</b> CORRECT ANSWERS</html>";
                       else                                      if(QuestionData.n[qCount]==3)
temp="<html>&nbsp;&nbsp;CHOOSE THE <b>THREE</b> CORRECT ANSWERS</html>";
else temp="<html>&nbsp;&nbsp;Hmm, it looks like they're <b>ALL</b> true</html>";
                       choose.setText(temp);
              }
              else {
                       timer.setText(" Your choices are shown in the boxes");
choose.setText(" Correct answers are hilighted in yellow");
              }}


/**
** recordAnswer keeps a track of the student answers given in the field String answers[]
**/
       public void recordAnswer(){
              String tmp = "";
              for(int i=0; i<boxes.length; i++) if(boxes[i].isSelected() ) tmp +=i+1;
answers[qCount] = tmp;
  }


/**



                                               51
** doAlert sends a warning to the user if there are only 2 minutes remaining on the time limit
**/
         public void doAlert(){
                timer.setForeground(Color.red);
                java.awt.Toolkit.getDefaultToolkit().beep();
                message.setText("Warning 2 minutes left");
                validate();
         }


/**
** endTest disables the 'next' and the 'previous' buttons and enables only the 'finish' button
**       if the user is out of time according to the time limit set
**/
         public void endTest(){
                message.setText("TIME OVER: please press 'finish'");
butt[2].setEnabled(false);
butt[3].setEnabled(false);
butt[4].setEnabled(true);
         }


/**
** colorTA method is used after the student completes the whole test and cycles through the
**       answers. The correct answers are shown by colouring the background of the text areas
yellow
**/
         public void colorTA(){
                for(int i=0; i<answerTA.length; i++) answerTA[i].setBackground(Color.white);
                for(int i=0; i<QuestionData.c[qCount].length(); i++)
                        answerTA[Integer.parseInt(QuestionData.c[qCount].substring(i,i+1))-
1].setBackground(Color.yellow);
                if(QuestionData.c[qCount].equals(answers[qCount]))       message.setText("Answer



                                                   52
correct, well done!");
                  else message.setText("Sorry, you got this one wrong.");
        }


/**
** calculateResult calculates the final score and instantiates a new JFrame which displays the
student results
** @see Quiz.Results
**/
        public void calculateResult(){
                  mark=0;
                  double temp=0.0;
java.text.DecimalFormat df = new java.text.DecimalFormat("#0.#");
                  for(int i=0; i<TOTAL; i++)if(QuestionData.c[i].equals(answers[i]))mark++;
                  temp=(double)mark;
                  if(temp/TOTAL*100       >=PASSMARK)          result.setText("        Well     done
"+name.substring(0,name.indexOf(' ') )+", you passed");
                  else result.setText(" Better luck next time "+name.substring(0,name.indexOf(' ') )
);
                  student.setText(" Final score for "+name+":      "+mark+" out of "+TOTAL+":
"+df.format(temp/TOTAL*100)+"%");
                  new Results().show();
        }}


/**
** Results is a minimizeable JFrame where the user is informed of each individual result
'correct' or 'incorrect'.
** The % scores and the 'PASS' or the 'FAIL' results are also displayed in the title bar and in the
frame itself.
** If the student has passed then a 'P' type icon is displayed in the frame title bar, otherwise a 'F'
icon is displayed



                                                  53
**/
class Results extends JFrame{
           Results() {
super( name+" results: " +(mark*100/TOTAL >=PASSMARK?"PASS":"FAIL") );
if(mark*100/TOTAL >=PASSMARK)
           {JOptionPane.showMessageDialog(null,"<html>YOU ARE APPOINTED<br>"+
                                 "    <br>     click        ok    button    to    see   result   </html>","
",JOptionPane.INFORMATION_MESSAGE);
           try {
           // Load Jdbc Odbc Driver
           Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
           Connection con = DriverManager.getConnection("jdbc:odbc:student1");
String sql = "update register set RESULT='"+n+"'"+" where NAME='"+name+"'";
Statement st = con.createStatement();
st.execute(sql);
JOptionPane.showMessageDialog(null, "your result Added Succesfully.","Record Added",
JOptionPane.INFORMATION_MESSAGE);
//clearControls();
           } catch (Exception se) {
           JOptionPane.showMessageDialog(null,se.getMessage(), "Error",
                                                 JOptionPane.ERROR_MESSAGE);
                          }}
else
       {
           JOptionPane.showMessageDialog(null,"<html>NOT ELIGIBLE<br>"+
                                 "      <br>     click       ok    button    to   see   result   </html>","
",JOptionPane.INFORMATION_MESSAGE);


           try {   // Load Jdbc Odbc Driver
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection con = DriverManager.getConnection("jdbc:odbc:student1");



                                                       54
String sql = "update register set RESULT='"+m+"'"+" where NAME='"+name+"'";
Statement st = con.createStatement();
st.execute(sql);
JOptionPane.showMessageDialog(null, "your result Added Succesfully.","Record Added",
JOptionPane.INFORMATION_MESSAGE);
//clearControls();
} catch (Exception se) {
JOptionPane.showMessageDialog(null,se.getMsg (),"Error",JOptionPane.ERROR_MESSAGE);
               }}
               Container cont = getContentPane();
               cont.setLayout(new GridLayout(TOTAL/2+3,5,2,5) );
               cont.setBackground(new Color(225,220,255) );
               cont.add(new        JLabel("              "+name+"        "+mark+"/"+TOTAL+":
"+(mark*100/TOTAL)+"%") );
for(int i=0; i<3; i++)cont.add(new JLabel() );
      String temp[] = new String[TOTAL];
                      for(int i=0; i<TOTAL; i++){
                               if(QuestionData.c[i].equals(answers[i])) temp[i]="correct";
                               else temp[i]="wrong";
                      }
for(int i=0; i<TOTAL; i++) cont.add(new JLabel(" Question "+(i+1)+": "+temp[i]));
pack();setLocation(200,200);
          }}


/**
** ItemHandler keeps track of the the number of answers the student provides in the answer
buttons
**     if they attempt to answer more times than there are answers to there is a
JOptionPane.showMessageDialog warning message
**/
class ItemHandler implements ItemListener{



                                                 55
public void itemStateChanged(ItemEvent evt){
if(startTheTest){
                  for(int i=0; i<boxes.length; i++) if(boxes[i].isSelected() ) itemCheck++;
                  if(itemCheck > QuestionData.n[qCount]){
                           java.awt.Toolkit.getDefaultToolkit().beep();
if(QuestionData.n[qCount]==1)            JOptionPane.showMessageDialog(null,"<html><font
size='4' color='00308a'><center>"+ "There is only "+QuestionData.n[qCount]+" possible<br>
answer                to             question             "+(qCount+1)+              "<html>","User
InformationMessage",JOptionPane.INFORMATION_MESSAGE);
else JOptionPane.showMessageDialog(null,"<html><font size='4' color='00308a'><center>"+
"There are only "+QuestionData.n[qCount]+" possible<br> answers to question "+(qCount+1)+
                "<html>","User Information Message",JOptionPane.INFORMATION_MESSAGE);
                  }
                  itemCheck=0;
          }}}
/**
** main instantiates the Quiz class and sets up a motif LookAndFeel
**/
         public static void main(String [] args){
                  try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
                  }
                  catch (Exception e) { System.out.println("Look and feel not supported"); }
                  Quiz frame = new Quiz();
                  frame.setTitle("   "+QuestionData.title);


         //frame.setIconImage(Toolkit.getDefaultToolkit().getImage(Quiz.class.getResource("q.gi
f")));
                  frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
                  frame.setVisible(true);
}}



                                                    56
QuestionData.java:

publicclass QuestionData{
static String info ="Java Programming Week 5 \n \nINSTRUCTIONS:\nThere are 25 question in
this test and 25 minutes to complete them all.\nWhen you are on the last question, the finish
button will be hilighted in blue, though you may choose to continue if you so wish and recheck
all your answers. \n \nWhen you click on finish, you will get your results immediately and have
the chance to see where you went wrong. When you check your answers against the correct
answers you may wish to use of the 'explain' button if you do not understand any of the answers
given. \n \nThe timer will begin when you click 'start' \n \nGood luck!\n";
static String []questions ={"Question 1:\nWhat would be the result of attempting to compile and
run the following program?\n\npublic class JavaApp{\npublic static void main(String args){\n
String myString = \"java\";\n System.out.println(myString);\n }\n}\n",
"Question 2:\nDescribe the result of attempting to compile and run the following program with
\n\n>javac JavaApp.java\n>java JavaApp\n\nclass First{\n String myStr = \"java\";\n}\n\nclass
JavaApp{\n\npublic          static      void      main(String[]    arg){\n      System.out.println(new
First().myStr);\n}\n}\n",
"Question 3: \nDescribe the result of attempting to compile and run the following program with
\n>javac JavaApp.java\n>java JavaApp\n\nclass JavaApp{ \n                String myString = \"rabbits\";
\npublic static void main(String[] arg){ \n                   System.out.println(myString); \n         }
\n}\n","Question 4:\nWhat would happen here?\n\nclass JavaApp{ \n                   public static void
main(String[] a){ \n                 String str = \"bunnies\";\n           for (int i=4; i<5; i++)\n
System.out.println(str); \n      } \n}\n","Question 5:\nWhat would be the result here?\n\nclass
JavaApp{ \n public static void main(String[] a){ \n         int j=0;\n   for (int i=0; i<3; i++) j=j+i;\n
System.out.println(j); \n      } \n}\n","Question 6:\nWhat would be the result here?\n\nclass
JavaApp{ \n public static void main(String[] a){ \n          int num1;\n     int num2 = 7;\n     num2=
num1 * 2 +3;\n    System.out.println(num2); \n } \n}\n","Question 7:\nWhat would be the result
here?\n\nclass JavaApp{ \n int num1;\n public static void main(String[] a){ \n               num1=2;\n
int num2 = 7;\n     num2= num1 * 2 +3;\n             System.out.println(num2); \n } \n}\n","Question
8:\nWhat would be the result here?\n\nclass JavaApp{ \n static int num1 = 4;\n public static
void main(String[] a){ \n             num1=2;\n       int num2 = 7;\n        num2= num1 * 2 +3;\n


                                                     57
System.out.println(num2); \n } \n}\n","Question 9:\nWhat would be the result here?\n\nclass
JavaApp{ \n static int num1 = 3;\n public static void main(String[] arg)\n               int num2 = 7;\n
num2= num2 + num1 * 2 +3;\n             System.out.println(num2); \n } \n}\n","Question 10:\nWhat
would be the output compiling and running the following code?\n\nclass JavaApp{ \n public
static void main(String[] a){\n        int i = (int) (Math.random());\n       System.out.println(i); \n }
\n}\n","Question 11:\nWhat would be the result here?\n\nclass JavaApp{ \n static String rabbit =
\"rabbit\";\n      public static void main(String[] a){\n                  int num = rabbit.length;\n
System.out.println(num); \n } \n}\n","Question 12:\nWhat would be the result here?\n\nclass
JavaApp{ \n public static void main(String[] a){\n         char []rabbit={'a','b','c','d'};\n    int num =
rabbit.length;\n     System.out.println(num); \n } \n}\n","Question 13:\nWhat would be the result
here?\n\nclass JavaApp{ \n public static void main(String[] a){\n           int num = 10;\n     String str =
Integer.toBinaryString(num);\n           System.out.println(str); \n      } \n}\n","Question 14:\nWhat
would be the result if we were to run this program with\n>java JavaApp hello java world
?\n\nclass JavaApp{ \npublic static void main(String[] args){\n            System.out.println(args[1]); \n
} \n}\n","Question 15:\nWhat would be the result of this program?\n\nclass JavaApp{ \n public
static void main(String[] a){\n       double d =1.75;\n    int i = d;\n     System.out.println(i++); \n }
\n}\n","Question 16:\nWhat would be the result of this program?\n\nclass JavaApp{ \n public
static void main(String[] a){\n        int 1stNum = 5;\n       int 2ndNum = 3;\n         double d =1.25
+1stNum/2ndNum;\n           System.out.println(d); \n } \n}\n","Question 17:\nWhat would be the
result of this program?\n\nclass JavaApp{ \n public static void main(String[] arg){\n            int $Num
= 5;\n       int _Num = 4;\n      double d =1.25 +$Num/_Num;\n               System.out.println(d); \n }
\n}\n","Question 18:\nWhat would be the result of this program?\n\nclass JavaApp{ \n static
float f;\n      public static void main(String[] ar){\n        int Num = 5;\n           f = 1.25;        \n
System.out.println(f*4); \n       } \n}\n","Question 19:\nWhat would be the result of this
program?\n\nclass JavaApp{ \n static float f;\n public static void main(String[] ar){\n            int Num
= 2;\n   f = (float)1.25 * 2;    \n   System.out.println(f * Num); \n } \n}\n","Question 20:\nWhat
would be the result of this program?\n\nclass JavaApp{ \n public static void main(String[] ar){\n
byte num = 64;\n       num += num;\n      System.out.println(num); \n } \n}\n","Question 21:\nWhat
would be the result of this program?\n\nclass JavaApp{ \n public static void main(String[] a){\n
double d = 1.56789;\n           long num = Math.round(d);\n               System.out.println(num); \n     }
\n}\n","Question 22:\nWhat would be the result of this program?\n\nclass JavaApp{ \n public



                                                   58
static void main(String[] a){\n    double d = 1.56789;\n      int num = (int)Math.round(d * d);\n
System.out.println(num); \n       } \n}\n","Question 23:\nWhat would be the result of this
program?\n\nclass JavaApp{\npublic static void main(String[] arg){\n       double doub1 = 1.51;\n
int num1 = (int) (doub1 +0.5);\n    System.out.println(num1); \n     double doub2 = -1.51;\n     int
num2 = (int) (doub2 +0.5);\n        System.out.println(num2); \n } \n}\n","Question 24:\nWhat
would be the result of this program?\n\nclass JavaApp{ \npublic static void main(String[] arg){\n
int num = 4;\n        num = (num + 4/2) % num+1;\n                 System.out.println(num); \n    }
\n}\n","Question 25:\nWhat would be the result of this program?\n\nclass JavaApp{ \n public
static void main(String[] ar){\n        for(int i=0; i<3; i++)\n          for(int j=1; j<3; j++)\n
System.out.print(j+i+\",\"); \n } \n}\n"};
static String [][]answers ={{"It will not compile as the main method String is not an array\n","It
will compile but there will be a runtime error if we try to run it with:- \n>java JavaApp\n","The
program is fine, but we will need another program to run it and get the output.\n","It will compile
and run and output \"java\" to the screen\n"},{"It will not compile as you cannot have 2 java
source files on the same page\n"," \nIt will output \"java\"\n","It will not compile as the String
myString is not-static and it is being accessed from a static method\n"," \nIt compiles but there is
no output at runtime\n"},{" \nFine - it will output rabbits\n","Runtime error JavaApp is not
public\n","Compiler error myString is a non-static variable being accessed in a static
method\n","Compile error in the main() method\n"},{" \nIt will output bunnies\n","The out put
will be    \nbunnies\nbunnies\n"," \nNo output the for loop needs a ' ; ' at the end\n","
\nCompilation error for loops have to start with a zero\n"},{" \n3\n"," \n6\n"," \n4\n"," \n2\n"},{"
\n17\n"," \n5\n"," \n3\n","It won't compile\n"},{" \n14\n"," \n7\n"," \n17\n"," \nError.\n"},{"
\n16\n"," \n14\n"," \n7\n"," \nError\n"},{" \n15\n"," \n23\n"," \n50\n"," \nError\n"},{" \n1\n","
\nYou cannot predict the random result\n"," \n0\n"," \nError\n"},{" \n6\n"," \n5\n"," \n0\n","
\nError\n"},{" \n4\n"," \n3\n"," \n0\n"," \nError\n"},{" \n00001010\n"," \n10\n"," \n1010\n","
\nError\n"},{"hello java world\n"," \nhello\n"," \njava\n"," \nworld\n"},{" \n1.75\n"," \n2\n","
\n3\n"," \nError\n"},{" \n3.25\n"," \n2.25\n"," \n2.2... and a very long number\n"," \nWill not
compile\n"},{" \n2.5\n"," \n2.25\n"," \n2.2 ... -something and a very long number\n"," \nWill not
compile\n"},{" \nError float f is not initialised\n"," \noutput: 5\n"," \noutput: 5.0\n"," \nError,
this is not a valid way to initialise a float type variable\n"},{" \n4.0\n"," \n5\n"," \n5.0\n","
\nError, it will not compile\n"},{" \n128\n"," \n-128\n"," \n1\n"," \nError, number is out of



                                                59
range\n"},{" \n1\n"," \n2\n"," \n1.0\n"," \nError\n"},{"3. - and something to 15 decimal
places\n"," \n2\n"," \n3\n"," \nError\n"},{" 2 \n-2\n"," 1\n-2\n"," 2\n-1\n"," 1\n-1\n"},{" \n1\n","
\n3\n"," \n4\n"," \n6\n"},{"1,2,2,3,3,4\n","1,2,3,3,4,6\n","1,2,3,4\n"," \n0,1,1,2,2,3,3,4\n"} };
static String []explain ={"\n\n\n\n\nThe main method must be \nmain(String[] args){ \n// etc \nin
order to produce an output at runtime. The code will compile and with the help of another
program which does have a properly formed main method the program could be run from this,
hence 'B' and 'C' are correct.\n","\n\n\n\n\nThis is valid and it would produce the output: java,
however if we had written\n          System.out.println(First.myStr); \nThe program would fail as
myStr is not static ... \n- tricky one here!\n","\n\n\n\n\nmyString has to be static as the main
method is also static. \nYou cannot access non-static variables from a static context, that's just
the way it is.\n","\n\n\n\n\nIt will only run through the loop once when i is 4, after this when i is
5 the loop stops. Also, if we were to put a ';' at the end of the loop the output would be the same
though the loop would be doing nothing.\n- Try it!\n","\n\n\n\n\nLet's go through it;-\nj= 0+0; //
j now = 0\nj= 0+1; // j now = 1\nj= 1+2; // therefore j=3\n","\n\n\n\n\nnum1 must be initialised.
In fact this can be a bit tricky for newcomers to java to get used to at first. \nThe rule is, inside a
method between this { and this } always initialise your variables!\n","\n\n\n\n\nA non-static
variable   (num1)    cannot    be    referenced   from    a   static   context!\nSo,    get   used   to
it.\n","\n\n\n\n\nNow this one is fine \n2 * 2 = 4 \nthen 4 + 3 = 7\n","\n\n\n\n\nLook again at the
main method. \nDo you see a { at the end!? \n \nDid you spot it? \n(possibly a bit cruel that
one)\n","\n\n\n\n\nMath.random() will alwys produce a number between 0.0 and 0.9999 etc,
when we cast such a number to an int we will get a zero (every time!).\n","\n\n\n\n\nThe length
of the string can be determined with the 'method'\n'length()' which will tell us how many
characters there are in the string\n'length' is used with arrays and it is a 'property' not a 'method' -
notice that there is no '()' (ie: \"...=str.length();\" ) known as 'parenthesis'.\n","\n\n\n\n\nThe code
is correct and valid. \ntheWhatever.length; \nfor an array returns the number of 'elements', or the
'subscript' of the array\n","\n\n\n\n\nThe code is correct, valid and the binary number of decimal
10 is:- \nDecimal     8 4 2 1\n------------------------\nBinary         1 0 1 0\nand the leading
zero's are not shown.\n","\n\n\n\n\nargs[1] is the second element in the array, therefore the
second word passed into the main args method is 'java' eg\n... main(String []args){\nis (in effect)
the same as saying;-\nString []args = {\"hello\",\"java\",\"world\"};\nargs[0] = \"hello\";\nargs[1]
= \"java\";\nargs[2] = \"world\";\n","\n\n\n\n\nYou cannot add a double to an int as int is 4 bytes



                                                  60
(or 32 bits) in size and the memory which is reserved for this data type is therefore limited to
this.\nThe double data type is 8 bytes or 64 bits 'wide' (wide is the correct term to use here). \nTo
the come back to the point:\nThey do not and cannot match! = ERROR!\n","\n\n\n\n\nThe
identifier names 1stNum and 2ndNum are invalid as variables cannot start with a number, they
must always start with \na letter, \nor a currency character, eg $myNum, \nor an underscore, eg
_myNum.\nAnything else is invalid\n","\n\n\n\n\nThe code is fine and the identifiers are all
valid, so 5 didvided by 4 is =1 because it is integers (whole numbers only therefore it cannot be
1.25).\neg: this is the same as saying;\ndouble d =1.25 + 1;\nAlso when we deal with 'clean'
fractions like this we will not get the 15 decimal places that double can produce (or the 7 that
float can produce)\n","\n\n\n\n\nWhenever there is any number with a decimal point, java will
treat it as a double (64 bits wide or 8 bytes in size), as float is only 32 bits wide (4 bytes)
therefore it cannot accommodate the floating point double value. \nbtw ... this would also be
invalid; \nint i = 5.5; \nand for the same reason 5.5 is 64 bits wide and int is 32 bits
wide\nFinally, this is also an error;-\nlong longNum = 5.5;\n","\n\n\n\n\nThe code is all OK and
here we use the cast \"(float)\" eg; \nfloat f = (float) 0.5; \nThis keeps everything above board
and because it is a float, there is a decimal value XXX.0 to it. \nNote that these are also valid
ways of creating float values \n \nfloat f = 0.5f; \nfloat f = 0.5F; \n \nThe easiest way to 'do' all or
deal with all of this as a programmer is to use doubles and ints all the time even though there is
also 'byte', 'short' and 'long' too, though these data types are very useful at times and do have
their place. When do we use them? Well that can come with time and in the meanwhile \nDO
NOT USE 'byte', 'short' or 'float' just to save a bit of memory in a simple
application.\n","\n\n\n\n\nAha! The range of a byte is indeed -128 to +127, so isn't 128 therefore
out of range? \nInstead it is! But java handles this in a bit of a funny way and it has to to with
binay addition eg;- \n127 = 01111111 \nif we add one to this in binary we get \n10000000,
\nwhich is -128 (as the first number is a 1).\nConfused, surprised? If you're serious about your
future in the world of programming, then a study of binary maths is very worthwhile and its jolly
clever the way it works too! \n \nThat was a nasty one eh!?\n","\n\n\n\n\nThis is valid and long
(64 bits wide and a whole number data type) is the correct data type to use in this case. \nThis
would be invalid;-\nint num = Math.round(d); \nbut this would be OK with the int cast;- \nint
num = (int) Math.round(d);\n","\n\n\n\n\nd is 1.5 ++? \n(and something and and a bit
more)\nAND;-\nd * d is 3, plus 0.??? (and something and and a bit more) so as the number is



                                                  61
larger than 3.0 then the whole number int value is rounded down to 3\n","\n\n\n\n\nHaha! \nYes
for a quick and simple rounding function the simple but effective use of; \nXXX + 0.5; // is very
useful ...\nIndeed it \nAlgorithms - they're great and if you can figure them out you are a
programmer in the making!\n"};
staticint []n = {2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
static                                           String                                       []c=
{"23","2","3","1","1","4","4","3","4","3","4","1","3","3","4","4","2","4","3","2","2","3","3","2","
1"};
staticinttally = c.length;
staticintpassMark=50;
static String title="Java Programming Week 5";
staticinttimeLimit =25;
}




                                                  62
OUTPUT:
Recruitment system home page:




Administrator login:




                                63
Applicant database:




Recruitment home page for applicant:




                                       64
Applicant registration:




                          65
Examination:




Authenticate the applicant:




                              66
Exam results:




                67
            10. COMPONENT AND DEPLOYMENT DIAGRAM
10.1 Component Diagrams
  10.1.1 Component Diagram Definition:
            A component represents a modular part of a system that encapsulates its
     contents and whose manifestation is replace within its environment. A component
     defines its behavior in terms of provided and required interfaces.
     10.1.2 Notation:
                        NewCo
                        mponent

                                  Component
                           NewCo                        NewCom
                           mponent                      ponent2

                                                                    Dependency symbol


     10.1.3 Interfaces:
            There are two types of interfaces as,
                 1. Required interface.
                            The component requires the interface to the another component
                 2. Provided interface.
                            The component provides the interface to the another component




                Provided interface:


                Required interface:




                                              68
    10.1.4 Collaboration diagram for recruitment system:



                   Applicant
                                                                   Payment




                   Recruitment officers                            Exam




                   Evaluation system                              Appointment generation




10.2 DEPLOYMENT DIAGRAM
    10.2.1 Definition:
           A deployment diagram in the unified modeling language serves to model the
    physical deployment of artifacts on deployment targets. Deployment diagrams show "the
    allocation of artifacts to nodes according to the Deployments defined between them. It is
    represented by 3-dimentional box. Dependencies are represented by communication
    association.
    10.2.2 Notations




                                           69
10.2.2 Deployment Diagram for recruitment System:




Conclusion
      Thus the project Recruitment System was developed by using Rational Rose Software for
developing UML diagrams and Eclipse for implementing the system.




                                           70
                             1. PROBLEM DEFINING STATEMENT
          Automation is the use of control systems and information technologies to reduce the need
for human work in the production of goods and services. In the scope of            industrialization,
automation is a step beyond mechanization. Whereas mechanization provided human operators
with machinery to assist them with the muscular requirements of work, automation greatly
decreases the need for human sensory and mental requirements as well. Automation plays an
increasingly important role in the world economy and in daily experience.


          Passport Automation System is used in the effective dispatch of passport to all of the
applicants. This system adopts a comprehensive approach to minimize the manual work and
schedule resources, time in a cogent manner. The core of the system is to get the online
registration form (with details such as name, address etc.,) filled by the applicant whose
testament is verified for its genuineness by the Passport Automation System with respect to the
already existing information in the database. This forms the first and foremost step in the
processing of passport application. After the first round of verification done by the system, the
information is in turn forwarded to the regional administrator's (Ministry of External Affairs)
office.


          The application is then processed manually based on the report given by the system, and
any forfeiting identified can make the applicant liable to penalty as per the law. The system also
provides the applicant the list of available dates for appointment to 'document verification' in the
administrator's office, from which they can select one. The system forwards the necessary details
to the police for its separate verification whose report is then presented to the administrator. The
administrator will be provided with an option to display the current status of application to the
applicant, which they can view in their online interface. After all the necessary criteria has been
met, the original information is added to the database and the passport is sent to the applicant.




                                                 71
             2. SOFTWARE REQUIREMENTS SPECIFICATION
1. Table of Contents:
1.0. Purpose………………………………………………………………………………….73
1.1. Introduction……………………………………………………………………………..74
1.2. Scope……………………………………………………………………………………74
1.3. References……………………………………………………………………………....74
1.4. Document overview…………………………………………………………………….74
2.0. Overall description……………………………………………………………………...74
2.1. System environment…………………………………………………………………….74
2.2. Functional requirements definitions…………………………………………………....74
2.3. Use cases…………………………………………………………………………….....74
    2.3.1. Use Case: Registration………………………………………………………...…75
    2.3.2. Use Case: Checkstatus…………………………………………………………...75
    2.3.3. Use Case: process application……………………………………………………75
    2.3.4. Use Case: dispatch passport……………………………………………………..75
2.4. Non-functional requirements…………………………………………………….…..…76
3.0. Requirement specifications………………………………………………………..……76
3.1. External interface specifications…………………………………………………….….76
3.2. Functional Requirements………………………………………………………….....…76
    3.2.1. Registration…………………………………………………………………...….76
    3.2.2. Checkstatus……………………………………………………………………….77
    3.2.3. process application…………………………………………………………..…..77
    3.2.4. dispatch passport……………………………………………………………........77
3.3. Detailed non-functional requirements…………………………………………………..78
3.4. System Evolution ……………………………………………………………………….78




                                 72
1.0 Purpose


If the entire process of 'Issue of Passport' is done in a manual manner then it would. Take
several months for the passport to reach the applicant. Considering the fact that the number of
applicants for passport is increasing every year, an Automated System becomes essential to meet
the demand. So this system uses several programming and database techniques to elucidate the
work involved in this process. As this is a matter of National Security, the system has been
carefully verified and validated in order to satisfy it.
        1.1. Introduction
                          Passport Automation System is an interface between the Applicant and
        the Authority responsible for the Issue of Passport. It aims at improving the efficiency in
        the Issue of Passport and reduces the complexities involved in it to the maximum possible
        extent.
        1.2 Scope
        • The System provides an online interface to the user where they can fill in their personal
        details and submit the necessary documents (may be by scanning).
        • The authority concerned with the issue of passport can use this system to reduce his
        workload and process the application in a speedy manner.
        • Provide a communication platform between the applicant and the administrator.
        • Transfer of data between the Passport Issuing Authority and the Local Police for
        verification of applicant's information.
        • Users/Applicants will come to know their status of application and the date in which
        they must subject themselves for manual document verification.


        1.3 References
            1. [IEEE] The applicable IEEE standards are published in “IEEE Standards
                  Collection,” 2001 edition.
            2. [Bruade] The principal source of textbook material is “Software Engineering: An
                  Object-Oriented Perspective” by Eric J. Bruade (Wiley 2001).
            3. [Reaves SPMP] “Software Project Management Plan Online Railway Reservation
            system



                                                   73
       1.4 Document Overview
               SRS includes two sections overall description and specific requirements - Overall
       description will describe major role of the system components and inter-connections.
       Specific requirements will describe roles & functions of the actors.


2.0 Overall Description


       The PAS acts as an interface between the 'applicant' and the 'administrator'. This system
tries to make the interface as simple as possible and at the same time not risking the security of
data stored in. This minimizes the time duration in which the user receives the passport.

          2.1. System environment: Software Requirement
                      Operating System -: Window XP
                       Database           -: MicrosoftAccess2007
                       Language            -: JAVA 2.0
                       Web Server          -: Apache
               Hardware Requirement
                       512RAM, Pentium P3/P4, 20/40 GB Hard disk

          2.2. Functional requirements definitions
               Functional Requirements are those that refer to the functionality of the system,
          i.e., what services it will provide to the user. Nonfunctional (supplementary)
          requirements pertain to other information needed to produce the correct system and are
          detailed separately.

          2.3. Use cases
               Use cases are text stories, widely used to discover and record requirements.
               They emphasize the user goals and perspective. The use case name starts with
               verb.
               The use cases used in this system are
                  Registration
                  Check status



                                                 74
            Process Application
            Dispatch passport

2.3.1. Use Case: Registration
    Brief Description:
                The Registration use case is accesed by the users which is used to register
    his/her details.
    Initial step-by-step description:
          For this use case to be initiated, the user enters into the passport automation
    system.
          1. The user read the terms and conditions to apply the passport.
          2. The user must accept the conditions.
          3. To fill the registration form and give submit.
2.3.2. Use Case: check status
    Brief Description:
                The check status use case is accesed by the users which is used to check
    the status of passport automation.
    Initial step-by-step description:
        i.     The user enter into the passport automation system and the status of
               his passport automation.
     ii.       The user must the details to the verification of passport.
    iii.       To continue the check status until he/she get the passport.
2.3.3. Use Case: process application
    Brief Description:
                The process application use case is accesed by the administrtator, which
    is used to check his/her details about the passport application and verify it.


    Initial step-by-step description:
         1.     The administrator gets the details about the user.
         2.     To process the details and verify it          with the already     existing
    database.



                                          75
                  3.   After the successful verification to create the passport for the
            particular user.


     2.3.4. Use Case: dispatch passport
            Brief Description:
                       The dispatch passport use case is used to deliver the passport to the
            corresponding end user.
            Initial step-by-step description:
                  1.   The administrator gets the successful verification.
                  2.   To create the new passport on the corresponding user.
                  3.   At the end to deliver the passport to the user.
3.0. Requirement specifications

     3.1. External interface specifications
     None

     3.2. Functional Requirements
            Functional Requirements are those that refer to the functionality of the system,
     i.e., what services it will provide to the user. Nonfunctional (supplementary)
     requirements pertain to other information needed to produce the correct system and are
     detailed separately.
     3.2.1. Registration
       Use Case Name                      Register applicant Details
       Priority                           Essential
       Trigger                            Menu selection
       Precondition                       Applicant is connected to the system.
       Basic Path                         The applicant should enter into the system.
       Alternate Path                     N/A
       Post condition                     The applicants on the passport automation system.

       Exception Path                     If there is a connection failure the passport
                                          automation Server returns to the wait state.


                                                76
3.2.1.check status:
  Use Case Name:              Check status
  Priority                    Essential
  Trigger                     Menu selection
  Precondition                Applicant is already registering to the system.
  Basic Path                  The applicant should register into the system.
  Alternate Path              N/A
  Post condition              The applicant‟s         passport should be under
                              processing to automation system.
  Exception Path              If there is a connection failure the passport
                              automation Server returns to the wait state.


3.2.1. process application
  Use Case Name:             Process application
  Priority                   Essential
  Trigger                    Menu selection
  Precondition               Applicant is connected to the system.
  Basic Path                 The applicant should register into the system.
  Alternate Path             N/A
  Post condition             The applicants should ready to get the passport.
  Exception Path             If there is a connection failure the passport
                             automation Server returns to the wait state.

3.2.1. dispatch passport
  Use Case Name:             Dispatch passport
  Priority                   Essential
  Trigger                    Menu selection
  Precondition               applicant is connected to the system.
  Basic Path                 The applicant     passport under processing into the
  Alternate Path             system.
                             N/A
  Post condition             The user collect his/her passport.
  Exception Path             If there is a connection failure the passport
                             aytomation Server returns to the wait state.


                                       77
3.3. Detailed non-functional requirements

Attribute Name              Attribute Type     Attribute Size
FirstName*#                 String             30
LastName*#                  String             30
Gender*#                    String             30
Date of Birth*#             String             50
Resident Address*#          String             50
Profession*#                String             30
Phone number*#              String             15
e-mail ID*#                 String             30
Account number*#            String             15
D/C Card number*#           String             15
Username*^                  String             30
Password*^                  String             50
Train no.#                  String             5
Source*#                    String             20
Destination*#               String             20
No.of Available seats*#     String             10

       Fields marked with an „*‟ are required fields. Fields marked with„#‟ can be visible or not
visible and is determined by the Passenger. Fields marked with a „^‟ are never visible to anyone
other than the Passenger.
       Hardware                :-passport automation Server
       Operation System        :-Window 98 or above
       Internet Connection     :-Existing telephone lines
       Performance             :-The system should generate the records in the
       Appropriate table of the Database applicant100% of the time.

3.4. System Evolution
       In the future this system will be update to allow students from the Computer Master‟s
Program to join. If time does not permit the search/e-mail section can be done, possibly by
another Master Studio student. A report generated by the system of the responses to the survey
could be another addition to the ORRS in the future.




                                                78
              3. IDENTIFY USE CASES AND DEVELOP USE CASE MODEL
3.1: use cases
        A use case describes a sequence of actions that provide something of measurable value
to an actor and is drawn as a horizontal ellipse.
       Use cases are text stories, widely used to discover and record requirements.The main
purpose of a use case diagram is to show what system functions are performed for which actor.
Roles of the actors in the system can be depicted
3.2: Use case model& use case diagram:
       Use case model provides an external view of the system or application ditected
towards the user or the actor of the system. Use case model express what the business or
application will do.
       Use case model is the set of all written use cases;it is a model of the system‟s
functionality and environment.
       Use case diagaram is a graph of actors,a set of usecases enclosed by a system
boundary,communication associations between the actors and the use cases and
generalization among the use cases.


       3.2.1: Actors& scenario
                 An actor anything with behaviour,including the system under discussion itself
       when it calls upon the services of other system. Example object , place, person or
       anything.
       Types:
            There are four types of actors in the UML, which are as follows:
            1. Primary actor: It uses a system‟s primary functions.
            2. Secondary actor: It uses a system‟s secondary functions.
            3. Active actor: It initiates the Use-Case.
            4. Passive actor: It only participates in one or more Use-Cases.


                 A scenario is the specific sequence of action and interactions between actors
       and the system. It is also called as the usecase instance.




                                                    79
3.2.2:use case symbols:




3.3:Identify the use cases

       The use cases involved in online railway reservation system are,
               Registration
               Check status
               Process Application
               Dispatch passport

      Documentation:

                The actors in this use case diagram are Applicant, Administrator and Database.
                The use cases are the activities performed by actors.
                Applicant will fill up the application form and submitted to the authority.
                The Applicant can check his status by using his id.
                Administrator verifies the information given by the applicant using id.
                If the information‟s are verified then the passport is issued.
           .
                 A use case is a methodology used in system analysis to identify, clarify, and
       organize system requirements. The use case is made up of a set of possible sequences of
       interactions between systems and users in a particular environment and related to a
       particular goal. It is represented using ellipse.
                 Actor is any external entity that makes use of the system being modeled. It is
       represented using stick figure.




                                                   80
3.4 Usecase model for passport automation system:




                                          81
                             4. UML ACTIVITY DIAGRAM
4.1 Business object modeling
       The UML activity diagram is used to visualize workflows and business processes.
4.2 Activity diagram
       The activity diagram is used to represent the dynamic view of the systems .aim
activity diagram shows sequential and parallel activities in a process they are useful for
modeling business process ,workflow ,data flow, and complex algorithms.
   4.2.1documentation of activity diagram
       This activity diagram flow of stepwise activities performed in recruitment system.
             Applicant fills up the form and submits to the Administrator.
             Applicant will get an id
             Using this id applicant can check his status.
             Using the id is login to the system.
             Admin will verify the application.
             If the data‟s are correct passport is issued.
       If the data‟s are not correct then cancel the application
    4.2.2 Activity Diagram UML Notations:




                                                82
4.3 Activity Diagram For Passport Automation System:
      4.3.1Check status




      4.3.2Admin panel




                                         83
5. IDENTIFY CONCEPTUAL CLASS AND DOMAIN MODEL DIAGRAMS
5.1 Domain model
       Domain model is a visual representation of conceptual classes or real situation objects in
a domain. Domain model is also called as conceptual model, domain object model and analysis
object model. A UML domain model will relate objects in the system domain to each other. It
will define concepts and terms. Objects in the domain model can be:

          Physical objects
          Abstract concepts

       5.1.1: Domain model a Picture of Software Business Objects
              A UP domain model is a visualization of things in a real situation domain of
       interest, not of software objects, or software objects with responsibilities.


       5.1.2: Domain model a Visual Dictionary
              Domain model visualizes and relates words or concepts in the domain. Therefore,
       the domain model is a visual dictionary of the remarkable abstractions, domain
       vocabulary and information content of the domain.


5.2 Guideline to create domain model
       5.2.1: Finding conceptual classes
       There are three strategies are followed to find the conceptual classes. They are,
           Reuse or modify existing models
           Use a category list
              Category list                            Example

              Transaction                              Payment

              Role of people or organization           Applicant, administrator

              Records of frame                         Register

              Container                                Passport automation




                                                 84
      Identify noun phrases
                Applicant
                Administrator
                System
      The conceptual sub classes can be found by using the following rules,
                100 % rule
                Is a rule


      5.2.2:Domain model diagram symbols


                 NewClass      Class symbol


                              Association line
5.3 Draw the class in UML diagram:




                                                 85
                          6. INTERACTION DIAGRAM
6.1 Sequence diagram
       A sequence diagram in Unified Modeling Language (UML) is a kind of interaction
diagram that shows how processes operate with one another and in what order. It is a construct of
a Message Sequence Chart. There are two dimensions.
1. Vertical dimension-represent time.
2. Horizontal dimension-represent different objects

       Primary objects, secondary object and message sequences all are identified. Sequence
diagram shows how the message exchanges in between two objects.
       Symbols




         6.1.1 Sequence diagram for Passport Automation System:




                                               86
6.1.2 Sequence diagram for admin panel




                                         87
   Documentation of sequence diagram
       The sequence diagram describes the sequence of steps to show
                Applicant fills up the form and submits to the Administrator.
                Applicant will get an id
                Using this id applicant can check his status.
                Using the id is login to the system.
                Admin will verify the application.
                If the data‟s are correct passport is issued.
                If the data‟s are not correct then cancel the application


6.2COLLABORATION DIAGRAM
       6.2.1 Definition
       A collaboration diagram, also called a communication diagram or interaction diagram,. A
sophisticated modeling tool can easily convert a collaboration diagram into a sequence diagram
and the vice versa. A collaboration diagram resembles a flowchart that portrays the roles,
functionality and behavior of individual objects as well as the overall operation of the system in
real time.
       Documentation of collaboration diagram
                 The first collaboration diagram is to show how the applicant login and submit the
       application form. The second collaboration diagram checks the status of the application.
       The third collaboration diagram is used to authentication.
       6.2.2 Symbol:



                                         Life Line box




                                                   88
6.2.3 Collaboration diagram for passport automation system:
      6.3.1new registration




      6.3.2Check status:




                                          89
6.3.3Admin panel




                   90
                             7. STATE CHART DIAGRAM:
   7.1 Definition:
       The purpose of state chart diagram is to understand the algorithm involved in performing
a method. It is also called as state diagram. A state is represented as a round box, which may
contain one or more compartments. An initial state is represented as small dot. A final state is
represented as circle surrounding a small dot.
       State chart diagram describes the flow of control from one state to another state. States
are defined as a condition in which an object exists and it changes when some event is triggered.
So the most important purpose of State chart diagram is to model life time of an object from
creation to termination.

       Following are the main purposes of using State chart diagrams:

              To model dynamic aspect of a system.
              To model life time of a reactive system.
              To describe different states of an object during its life time.
              Define a state machine to model states of an object.

       The objects are generally in two types as follows,
              State-dependent-with respect to that event.
              State-independently-an object reacts the same way.
       Transition:
               The transition can cause an action fire.in software implementation, this may
       represent the invocation of method of the class of the state diagram.


7.2 UML Symbol




                                                 91
7.3 UML State Chart Diagram for Passport Automation System:




Documentation of state chart diagram
    This state diagram describes the behavior of the system.
          First state is login where the applicant login to the passport automation system.
          A new registration is carried out
          Applicant enter the details
          Applicant is successfully registered.




                                            92
                   8. LOGICAL ARCHITECTURE DIAGRAM
8.1 Logical Architecture Definition
       The logical architecture is the large-scale organization of the software classes into
packages (or namespaces), subsystems, and layers. It‟s called logical architecture because there‟s
no decision about how these elements are deployed across different operating system processes
or across physical computers in a network.


8.2 Layers of Logical Architecture Explanation


       User Interface Layer:
               This layer which provides Graphical User Interface (GUI) objects such as forms
               and frames for communicating with the users through their needs and
               requirements.


       Application Logic or Domain Object Layer:
               Software objects representing domain concepts (for example, a software class
               sale) that fulfill application requirements, such as calculating a sale total.


       Technical Services Layer:
               General purpose objects and subsystems that provide supporting technical
               services, such as interfacing with a database or error logging. These services are
               usually application-independent and reusable across several systems.


8.3 Logical Architecture diagram symbols


                                               Package symbol



                                       Class Symbol




                                                 93
8.4 Logical Architecture diagram for passport automation System




                                       94
    9. IMPLEMENTATION UI, APPLICATION LOGIC AND TECHNICAL SERVICE
                                          LAYERS
import java.sql.*;
import java.awt.*;
importjava.awt.event.*;
importjavax.swing.*;
classLoginForm implements ActionListener
{
       JButton b1,b2;
       staticJFrame f1;
       JPanel p,p1;
       JLabel l1,l2;
       JTextField t1;
       JPasswordField t2;
       staticResultSet r1;
       static Connection conn1;
       static Statement stat1;
       staticint i;
       static String uname[]=new String[100];
       static String pword[]=new String[100];
       Avail a1;
       LoginForm()
       {
                f1=new JFrame("PASSPORT AUTOMATION SYSTEM");
                p=new JPanel(new GridLayout(3,2));
                //p1.setLayout(new FlowLayout(FlowLayout.CENTER));
                b1=new JButton("SIGN IN");
                b2=new JButton("CANCEL");
                l1=new JLabel("      USER NAME:");
                l2=new JLabel("      PASSWORD:");
                t1=new JTextField(10);



                                                95
t2=new JPasswordField(10);
p.add(l1);
p.add(t1);
p.add(l2);
p.add(t2);
p.add(b1);
p.add(b2);
f1.add(p);
//f1.add(p1);
f1.setSize(300,200);
f1.setVisible(true);
f1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
b1.addActionListener(this);
b2.addActionListener(this);
try
{
       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
       conn1 = DriverManager.getConnection("jdbc:odbc:ktk");
       stat1 = conn1.createStatement();
       r1 = stat1.executeQuery("Select * from login");
       i=0;
       while(r1.next())
       {
                uname[i]=r1.getString(1);
                pword[i]=r1.getString(2);
                i++;
       }
}
catch(Exception e)
{
       System.out.println("Error :" +e);



                                 96
           }
     }


     @SuppressWarnings("deprecation")
     public void actionPerformed(ActionEventae)
     {
           if(ae.getSource()==b1)
           {
     try
                  {
                         String u=t1.getText();
                         String p=t2.getText();
                         for(i=0;i<uname.length;i++)
                         {
                                if((uname[i].equals(u))&&(pword[i].equals(p)))
                                {
                                        a1=new Avail();
                                        f1.setVisible(false);
                                        break;
                                }
                                else
                                        continue;
                         }
                  }
                  catch(Exception e)
                  {
                  System.out.println("Error" +e);
                  JOptionPane.showMessageDialog(f1,"INCORRECT LOGIN or
PASSWORD","Login Error",JOptionPane.ERROR_MESSAGE);
                  }
           }



                                          97
                  else           {
                         System.exit(1);
                  }}
       public static void main(String args[])
       {
                  Module1 obj = new Module1();
obj.createUI();
       }}
class Avail implements ActionListener
{
       JFrame f2;
       JPanel p,p1,p2,p3;
       JLabel l1,l2,l3,l4,l5;
       JComboBox cb1;
       JTextField t2,t3,t4,t5;
       JButton b1,b2,b3,b4;
       staticResultSet r2;
       static Connection conn2;
       static Statement stat2;
       int i;
       static String tname[]=new String[100];
       static String tno[]=new String[100];
       static String src[]=new String[100];
       static String des[]=new String[100];
       static String noofavail[]=new String[100];
       public Avail()
       {
                  f2=new JFrame("REGISTRATION FORM");
                  p=new JPanel();
                  p1=new JPanel();
                  p2=new JPanel();



                                                 98
p3=new JPanel();
p.setLayout(new FlowLayout());
p1.setLayout(new GridLayout(4,2));
p2.setLayout(new FlowLayout());
b1=new JButton("SHOW");
b2=new JButton("REGISTER");
b3=new JButton("EXIT");
b4=new JButton("GO TO CANCEL PAGE");
l1=new JLabel("APPLICANT NAME:");
cb1=new JComboBox();
t2=new JTextField(10);
t3=new JTextField(10);
t4=new JTextField(10);
t5=new JTextField(10);
p.add(l1);
p.add(cb1);
p.add(b1);
p1.add(l2);
p2.add(l5);
p2.add(t5);
p2.add(b2);
p2.add(b3);
f2.setSize(500,200);
f2.setVisible(true);
f2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
try
{



                              99
             Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
             conn2 = DriverManager.getConnection("jdbc:odbc:ktk");
             stat2 = conn2.createStatement();
             r2 = stat2.executeQuery("Select * from schedule");
             i=0;
             while(r2.next())
             {      tname[i]=r2.getString(1);
                    tno[i]=r2.getString(2);
                    src[i]=r2.getString(3);
                    des[i]=r2.getString(4);
                    noofavail[i]=r2.getString(5);
                    i++;
             }for(i=0;i<tname.length;i++)
             {      cb1.addItem(tname[i]);
             }}
      catch(Exception e)
      {      System.out.println("Error:" +e);
      }}
public void actionPerformed(ActionEventae)
{     if(ae.getSource()==b1)
      {             try
             {      for(i=0;i<tname.length;i++)
                    {              if(tname[i].equals(cb1.getSelectedItem()))
                            {      t2.setText(tno[i]);
                                   t3.setText(src[i]);
                                   t4.setText(des[i]);
                                   t5.setText(noofavail[i]);
                                   break;
                            }      else
                                   continue;
                    }



                                     100
                        }catch(Exception e)
                        {System.out.println("Error" +e);
                        JOptionPane.showMessageDialog(f2,"ENTER THE CORRECT
APPLICANT NAME","Error",JOptionPane.ERROR_MESSAGE);
                        }}
               else if(ae.getSource()==b2)
               {        String x=(String)cb1.getSelectedItem();
                        new Reserve(x);
                        f2.setVisible(false);
               }        else if(ae.getSource()==b4)
               {        String x=(String)cb1.getSelectedItem();
                        f2.setVisible(false);
                        new Cancel(x);
                        }else
               {        String x=(String)cb1.getSelectedItem();
                        new Cancel(x);
                        f2.setVisible(false);}
       }
       public static void main(String args[])
       {       new Avail();
       }}
class Reserve implements ActionListener
{      JFrame f3;
       JPanel p,p1,p2;
       JLabel l1,l2,l3,l4,l5,l6,l7,l8;
       JButton b1,b2,b3;
       JTextField t1,t2,t3,t4,t5,t6;
       JComboBox cb1;
       JTextArea ta1;
       staticResultSet r3;
       static Connection conn3;



                                                 101
static Statement stat3;
staticResultSet r4;
static Connection conn4;
static Statement stat4;
int i;
static String tname[]=new String[100];
static String t;
int no;
static String noofavail[]=new String[100];
Cancel c1;
Reserve(String temp)
{
          t=temp;
          f3=new JFrame("REGISTRATION PAGE");
          p=new JPanel(new GridLayout(4,2));
          p1=new JPanel();
          p2=new JPanel();
          p1.setLayout(new FlowLayout());
          l1=new JLabel("SELECTED APPLICANT NAME:");
          l2=new JLabel("APPLICANT NO:");
          l3=new JLabel("AGE:");
          l4=new JLabel("D.O.B:");
          l5=new JLabel("GENDER:");
          l6=new JLabel("ADDRESS:");
          l7=new JLabel("PHONE NUMBER:");
          l8=new JLabel("NO OF VALIDATION YEARS:");
          t1=new JTextField();
          t1.setText(t);
          t2=new JTextField(10);
          t3=new JTextField(10);
          t4=new JTextField(10);



                                         102
cb1=new JComboBox();
cb1.addItem("MALE");
cb1.addItem("FEMALE");
ta1=new JTextArea(3,3);
t5=new JTextField(10);
t6=new JTextField(10);
b1=new JButton("CONFRIM REGISTER");
b2=new JButton("GO TO CANCEL PAGE");
b3=new JButton("EXIT");
p.add(l1);
p.add(t1);
p.add(l2);
p.add(t2);
p.add(l3);
p.add(t3);
p.add(l4);
p.add(t4);
p.add(l5);
p.add(cb1);
p.add(l6);
p.add(ta1);
p.add(l7);
f3.setSize(650,300);
f3.setVisible(true);
f3.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
try
{
       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");



                              103
             conn3 = DriverManager.getConnection("jdbc:odbc:ktk");
             stat3 = conn3.createStatement();
             r3 = stat3.executeQuery("Select * from schedule");
             i=0;
             while(r3.next())
             {
                    tname[i]=r3.getString(1);
                    noofavail[i]=r3.getString(5);
                    i++;
             }
      }
      catch(Exception e)
      {
             System.out.println("Error:" +e);
      }}
public void actionPerformed(ActionEventae)
{
      if(ae.getSource()==b1)
      {
             try
             {for(i=0;i<tname.length;i++)
                    {              if(tname[i].equals(t1.getText()))
                            {int no=Integer.parseInt(t6.getText());
                                   int no1 = Integer.parseInt(noofavail[i])-no;
                                   if(no>0)
                                   {
                                   try
                                   {i++;


Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn4 = DriverManager.getConnection("jdbc:odbc:ktk");



                                       104
       stat4 = conn4.createStatement();
       JOptionPane.showMessageDialog(f3,"REGISTER SUCCESSFUL!!","THANK
YOU!!",JOptionPane.INFORMATION_MESSAGE);
       r4 = stat4.executeQuery("insert into reserve
values('"+t1.getText()+"','"+t2.getText()+"','"+t3.getText()+"','"+t4.getText()+"','"+cb1.getSelect
edItem()+"','"+ta1.getText()+"','"+t5.getText()+"','"+no+"')");
       }catch(Exception e)
       {System.out.println("Error:"+e);}
       try
       { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
       conn3 = DriverManager.getConnection("jdbc:odbc:ktk");
       stat3 = conn3.createStatement();
       r3 = stat3.executeQuery("update schedule set noofvalidation years='"+no1+"' where
applicantname='"+t1.getText()+"'");
       }catch(Exception e)
       {System.out.println("Error:"+e);}
                                                 break;}
                                                 else
                                                 {JOptionPane.showMessageDialog(f3,"ENTER
THE NO OF VALIDATION YEARS","Error",JOptionPane.ERROR_MESSAGE);
                              break;}
                                        } else
                                        continue;
                              }}catch(Exception e)
                       {      System.out.println("Error" +e);
                              JOptionPane.showMessageDialog(f3,"ENTER THE CORRECT
APPLICANT NAME","Error",JOptionPane.ERROR_MESSAGE);
                       }      }
               else if(ae.getSource()==b2)
               { String x=(String)t1.getText();
                       f3.setVisible(false);



                                                    105
                         new Cancel(x);
                } else
                {        f3.setVisible(false);
                         System.exit(1);
                }}}
class Cancel implements ActionListener
{ JFrame f3;
       JPanel p;
       JPanel p1,p2;
       JLabel l1,l3,l2;
       JButton b1,b2,b3;
       JTextField t1,t3,t2;
       staticResultSet r3;
       staticResultSet r4;
       static Connection conn3;
       static Statement stat3;
       int i;
       Cancel c1;
       String t;
       static String tname[]=new String[100];
       static String pname[]=new String[100];
       static String noofseat[]=new String[100];
       static String noofavail[]=new String[100];
       Cancel(String temp)
       {
                t=temp;
                f3=new JFrame("CANCELLATION PAGE");
                p=new JPanel(new GridLayout(3,2));
                p1=new JPanel(new FlowLayout(FlowLayout.CENTER));
                p2=new JPanel();
                l1=new JLabel("SELECTED APPLICANT NAME:");



                                                 106
l2=new JLabel("APP NO TO CANCEL:");
l3=new JLabel("APPLICANT NAME:");
t1=new JTextField(10);
t1.setText(t);
t2=new JTextField(10);
t3=new JTextField(10);
b1=new JButton("CONFRIM CANCEL");
b2=new JButton("EXIT");
b3=new JButton("GO TO SCHEDULE PAGE");
p.add(l1);
p.add(t1);
p.add(l3);
p.add(t3);
f3.add(p2);
f3.setSize(350,200);
f3.setVisible(true);
f3.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
try
{       Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        conn3 = DriverManager.getConnection("jdbc:odbc:ktk");
        stat3 = conn3.createStatement();
        r3 = stat3.executeQuery("Select * from reserve");
        i=0;
        while(r3.next())
        {
                 tname[i]=r3.getString(1);
                 pname[i]=r3.getString(2);
                 noofseat[i]=r3.getString(8);



                                  107
                        i++;
                }}catch(Exception e)
       {
                System.out.println("Error:" +e);
       }        try
       { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                conn3 = DriverManager.getConnection("jdbc:odbc:ktk");
                stat3 = conn3.createStatement();
                r4 = stat3.executeQuery("Select * from schedule");
                i=0;
                while(r4.next())
                { noofavail[i]=r4.getString(5);
                        i++;           }}
       catch(Exception e)
       {     System.out.println("Error:" +e);
       } }
public void actionPerformed(ActionEventae)
{ if(ae.getSource()==b1)
       {                try
                {       for(i=0;i<tname.length;i++)
                        {              if(tname[i].equals(t1.getText()))
                               {int no=Integer.parseInt(t2.getText());
                               int no1=Integer.parseInt(t2.getText());
                               no1=Integer.parseInt(noofseat[i])-no;
                               no=Integer.parseInt(noofavail[i])+no;
                               if(no1>0)
                               {
                               try
{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn3 = DriverManager.getConnection("jdbc:odbc:ktk");
stat3 = conn3.createStatement();



                                         108
       r4 = stat3.executeQuery("update schedule set noofvalidation years='"+no+"' where
applicantname='"+t1.getText()+"'");
       }catch(Exception e)
       {System.out.println("Error:"+e);
       }try
              {
              stat3 = conn3.createStatement();
              r3 = stat3.executeQuery("update reserve set appno to cancel='"+no1+"' where
applicantname='"+t3.getText()+"'");
              }      catch(Exception e)
              {System.out.println("Error:"+e);
              }
JOptionPane.showMessageDialog(f3,"CANCELLATION SUCCESSFUL!!","THANK
YOU!!",JOptionPane.INFORMATION_MESSAGE);
              }      else
       {JOptionPane.showMessageDialog(f3,"ENTER THE CORRECT APP NO
","Error",JOptionPane.ERROR_MESSAGE);}
                             break;
                             }Else continue;
                             }}
                     catch(Exception e)
                     {System.out.println("Error" +e);
                     JOptionPane.showMessageDialog(f3,"ENTER THE CORRECT
APPLICANT NAME","Error",JOptionPane.ERROR_MESSAGE);
                     }
              }
              else if(ae.getSource()==b3)
              {f3.setVisible(false);
                     new Avail();
              }              else
              {      f3.setVisible(false);



                                               109
                       System.exit(1);
                  }
         }        }
MODULE:2
importjava.awt.Container;
importjava.awt.GridLayout;
importjava.awt.event.ActionEvent;
importjava.awt.event.ActionListener;
importjavax.swing.JPasswordField;
importjavax.swing.JTextField;
public class Module1 implements ActionListener {
JLabel
lblFName,lblLname,lblGender,lbldob,lbladdr,lblocc,lblphno,lbleid,lblaccno,lbldcno,lbluname,lbl
pswd,lblpswd1,lblsque,lblF,lblL,lblg,lbld,lbla,lblo,lblp,lble,lblacc,lbldc,lblun,lblpwd,lblsq,
lblFVal,lblLVal,lblgVal,lbldVal,lblaVal,lbloVal,lblpVal,lbleVal,lblaccVal,lbldcVal,lblunVal,lbl
pwdVal,lblsqVal;
JTextField txtFName,txtLName,txtdob,txta,txtp,txte,txtacc,txtdc,txtun,txtpwd,txtpwd1,txtsq;
JButtonbtnAdd,btnDelete;
JComboBoxtxtgender,txto;
ResultSetrs;
staticJFrame frame;
public static void main(String[] args) {
      Module1 obj = new Module1();
obj.createUI();
  }
voidcreateUI()
  {
frame = new JFrame("PASSPORT AUTOMATION SYSTEM-REGISTRATION FORM");
JPanelpnlInput = new JPanel(new GridLayout(13,2));
lblFName = new JLabel("                  *FIRST NAME : ");
txtFName = new JTextField(15);



                                                110
lblLname = new JLabel("             *LAST NAME : ");
txtLName = new JTextField();
lblGender = new JLabel("            GENDER : ");
txtgender=new JComboBox();
txtgender.addItem("MALE");
txtgender.addItem("FEMALE");
lbldob = new JLabel("            *DATE OF BIRTH : ");
txtdob = new JTextField();
lbladdr = new JLabel("            *RESIDENT ADDRESS : ");
txta = new JTextField();
lblocc=new JLabel("              PROFESSION:");
txto=new JComboBox();
txto.addItem("STUDENT");
               txto.addItem("BUSINESS");
               txto.addItem("INDUSTRIALIST");
               txto.addItem("RESEARCH SCHOLARS");
               txto.addItem("SOFTWARE");
lbluname=new JLabel( "             *USER NAME:");
txtun=new JTextField();
lblpswd=new JLabel("             *PASSWORD:");
txtpwd=new JPasswordField(15);
     lblpswd1=new JLabel("             *RETYPE PASSWORD:");
     txtpwd1=new JPasswordField(15);
pnlInput.add(txta);
pnlInput.add(lblocc);
pnlInput.add(txtun);
pnlInput.add(lblpswd);
pnlInput.add(txtpwd);
pnlInput.add(lblpswd1);
pnlInput.add(txtpwd1);
JPanelpnlButton = new JPanel(new GridLayout(1,2));



                                           111
btnAdd = new JButton("REGISTER");
btnAdd.addActionListener(this);
btnDelete = new JButton("LOGIN");
btnDelete.addActionListener(this);
pnlButton.add(btnAdd);
pnlButton.add(btnDelete);
      Container cn = frame.getContentPane();
cn.setLayout(new BoxLayout(cn,BoxLayout.Y_AXIS));
frame.add(pnlInput);
frame.add(pnlButton);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
  }
public void actionPerformed(ActionEventevt) {
      String action = evt.getActionCommand();
if(action.equals("REGISTER"))
      {
addOperation();
}else if(action.equals("LOGIN"))
      { @SuppressWarnings("unused")
                        LoginForm lf1;
          lf1 = new LoginForm();
frame.setVisible(false);
      }
  }
private void addOperation()
  {
try
      {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");



                                                112
           Connection con = DriverManager.getConnection("jdbc:odbc:ktk");
           String sql = "INSERT INTO
login(username,password,FName,LName,DateofBirth,Gender,ResidentAddress,Profession,Phon
eNumber,EmailID,AccountNumber,DebitorCreditcardnumber) " +
               "Values ('"+txtun.getText()+"',"+
                    "'"+txtpwd.getText()+"'," +
                    "'"+txtFName.getText()+"'," +
                    "'"+txtLName.getText()+"'," +"'"+txtdob.getText()+"',"+
                    "'"+txtgender.getSelectedItem()+"',"+ "'"+txtdc.getText()+"')";
           Statement st = con.createStatement();
st.execute(sql);
JOptionPane.showMessageDialog(null, "REGISTERED SUCCESSFULLY!!!","Record
Added",JOptionPane.INFORMATION_MESSAGE);
clearControls();
@SuppressWarnings("unused")             LoginForm lf1;
lf1 = new LoginForm();
frame.setVisible(false);
}catch(Exception e)
      {
JOptionPane.showMessageDialog(null, "ENTER IN THE APPROPRIATE
FIELDS","Error",JOptionPane.ERROR_MESSAGE);
      }}
private void clearControls()
  {        txtFName.setText("");
txtLName.setText("");
txtgender.setToolTipText("");
txtdob.setText("");
txta.setText("");
txto.setToolTipText("");


  }        }



                                                   113
OUTPUT:
Registration form:




Records into the database:




                             114
Delete the records:




Cancel operation:




                      115
Registration form:




Registration page:




                     116
Cancel page:




               117
     10 .COMPONENT DIAGRAM & DEPLOYMENT DIAGRAM
10.1 COMPONENT DIAGRAM
      10.1.1 Definition:
         The component diagram's main purpose is to show the structural relationships
      between the components of systems. It is represented by boxed figure. Dependencies
      are represented by communication association.


      10.1.2 Notation:
                    NewCo
                    mponent

                              component

                         NewCo                        NewCom
                         mponent                      ponent2

                                                                Dependency symbol
      10.1.3 Interfaces:
         There are two types of interfaces as,
                           1. Required interface.
                           2. Provided interface.


             Provided interface:


             Required interface:




                                            118
10.2 Component Diagram for Passport Automation System:



                                       passport automation
                                       system




        application            admin                         admin              admin
        status                 panel                         authentication     status




      Documentation of component diagram
               The main component in this component diagram is online passport automation
      systems. And applicant, administrator, database come under the main component.


10.2 DEPLOYMENT DIAGRAM


      10.2.1 Definition:
               A deployment diagram in the unified modeling language serves to model the
      physical deployment of artifacts on deployment targets. Deployment diagrams show "the
      allocation of artifacts to nodes according to the Deployments defined between them. It is
      represented by 3-dimentional box. Dependencies are represented by communication
      association.




                                                 119
 10.2.2 Notations




 10.2.2 Deployment Diagram for Passport Automation System:


                           passport automation system




    new                                                         admin
                              application                    authentication
registeration
                                status




                                     120
      Documentation of deployment diagram
              The processor in this deployment diagram is the online passport system which is
       the main part and the devices are the submitting the form, verify and issue which are the
       some of the main activities performed in the system.




Conclusion
       Thus the project Passport Automation system was developed by using Rational Rose
Software for developing UML diagrams and Eclipse for implementing the system.




                                              121

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:560
posted:8/23/2011
language:English
pages:121