Anda di halaman 1dari 55

Multiple Choice Questions

Project Report
BCA(6th sem)

Submitted To:Lect.Mrs. Purnima

Submitted By:Sandeep Kaur

Sh.L.B.S.Arya Mahila
College,Barnala
1

PREFACE
The Multiple Choice Questions is a great improvement over the
manual system like hand written exams. The computerization of
the system has speed up the process and it is time consuming. It
is very difficult to keep answer papers and all such things. The
system was thoroughly checked and tested with dummy data. The
system avoids data redundancy and inconsistency. It provides
security and integrity. Data is easily retrieved. Thus the system is
user friendly.
Being able to process data and use effectively is vital to both
private and public organizations. Without the improvement and reliability
of system, it would be impossible for a business to exist for very long.
The information system of organization consist of a number of
subsystem involved in the collection where complex decision problem
are solved by computer routines.

A CKNOWLEDGEMENT
2

It is incredibly gigantic task to quantify the contribution of those who were


directly or indirectly associated with this project because doing so would
be belittling their invaluable support which we got throughout the project.
We express our profound sense of gratitude to Lect. Purnima of the Sh.
L.B.S.Arya Mahila College. for providing various facilities needed for
successful completion of the project and for time to time enunciating
concept related to project.
We own our special thanks to all the faculty members of the centre
who helped us in completion of our project, for proper help and
constructive criticism in developing the project. The overall systematic
approach and encouragement inspire me to overcome the problem in
completion such a stupendous work. Last but not the least I want to thanks
my friends for their willing cooperation during development of project.
Thanks.

Students Sign:-

PROJECT DESCRIPTION
3

The project Multiple Choice Questions is developed in Java, which


mainly focuses on basic Exam operations. Multiple Choice Questions
is a windows application written for 32bit Windows operating systems,
designed to help users to give exams.
In our project Multiple Choice Questions we can create an account,
writing exam using that account and we get our result also.In this new user
can SignUp and already exists user can LogIn and then SelectExam
and perform their test.It is easy to understand . this project can be easily
accessed by both technical and non-technical users and can fulfill their
needs.
The Multiple Choice Questions is a great
improvement over the manual system like hand written exams.

The computerization of the system has speed up the process and


it is time consuming. It is very difficult to keep answer papers
and all such things. The system was thoroughly checked and
tested with dummy data. The system avoids data redundancy and
inconsistency. It provides security and integrity. Data is easily
retrieved. Thus the system is user friendly.
Our proposed system has the following advantages.
User friendly Interface
Fast access to database
Less error
Storage Capacity

INTRODUCTION
Java is a general purpose ,object oriented programming language
developed by Sun Microsystems of USA in 1991.Originally called Oak
by James Gosling .Java was designed for the development of software
for consumer electronic devices like TVs , VCRs,and such other
electronic machines.

Features of Java1.
2.
3.
4.
5.
6.
7.
8.

Compiled And Interpreted


Platform Independent And Portable
Object Oriented
Robust And Secure
Distributed
Simple , Small And Familiar
Multithreaded And Interactive
High Performance

INTRODUCTION TO THE AWT

AWT stands for Abstract Window ToolKit. The Abstract


Window Toolkit provides many classes for programmers to
use. It is your connection between your application and the
6

native GUI. The AWT hides you from the underlying details
of the GUI your application will be running on and thus is at
very high level of abstraction.
It is a Java package and can be used in any Java
program by importing java.awt.* via the import keyword.
Structure of the AWT
The structure of the AWT is rather simple. Controls are components that
allow a user to interact with your application in various ways:-.
The AWT hierarchy
Classes:

Component

Button

Checkbox

Choice

Container

Panel

Window

Label

List

Scrollbar
7

Text Compoment

TextArea

TextField

Image

MenuComponent

MenuBar

MenuItem

CheckboxMenuItem

Menu

INTRODUCTION TO SWING
Swing is a set of classes that provide more powerful and flexible
component than are possible with the AWT. these components such as
buttons ,check boxes and labels, Swing supplies several exciting additions ,
including scroll panes ,trees and tables.these components such as buttons
hae more capabilities in Swing . for example, a button may have both
image and a text string associated with it. Also the image can be changed as
the state of button changes. Unlike, AWT component , Swing components
are not implemented by platform independent.

The Swing component classes are:Classes

Description
8

AbstractButton

Abstract superclass for Swing button

JApplet

The swing version of Applet.

JButton

The swing push button classes.

JCheckBox

The swing checkbox classes.

JComboBox

Encapsulate a Combo Box(combination of a drop


down list & text field)

JLabel

The swing version of a Label.

JRadioButton

The swing version of a RadioButton.

JScrollPane

Encapsulate a Scroll Window.

JTextField

The swing version of a TextField.

INTRODUCTION OF JDBC
JDBC (Java Database Connectivity) is a standard API for accessing
relational databases from a Java program. This interface makes it easy to
access a database because it provides an abstract layer that hides the lowlevel details, such as managing sockets. It also provides for
interoperability and portability since it allows a single application to access
multiple database management systems simultaneously. For example, a
single application can query and manipulate a database in Oracle and a
9

database in DB2. Communication with a database management system


(DBMS) is through method calls. These calls are passed to the driver,
which in turn, translates them into DBMS-specific calls. The driver
basically acts like a set of library routines. Therefore, to get your program
to communicate with a particular DBMS, you need a compatible JDBC
driver. The basic steps to get your program up and running are:

1. Load the driver and register it with the driver manager


2. Connect to a database
3. Create a statement
4. Execute a query and retrieve the results, or make changes to the database
5. Disconnect from the database.

The need of JDBC


Java has been called "the vehicle by which developers will be able to bring
dynamic application behavior to the Web" . Users can download applets
from either local or remote Web servers for execution inside popular Web
browsers such as Netscape Navigat or. Applets run disconnected from the
server, just like native applications. Java however, has fallen short of its
widely ability to connect to outside resources via a build-in API. The first
release of the Java Developers Kit (JDK) in early 1995 had no integrated
support for accessing databases. The functionality of Java made it easy to
build tools for accessing databases, but there was no prescription about
how such drivers ought to function. Several vendors produced good tools
for database access but here were no general guidelines for how database
access tools should be written.
10

JDBC Architecture
The JDBC Architecture consists of two layers: the JDBC API, which
provides the application-to-JDBC Manager connection, and the JDBC
Driver API, which supports the JDBC Manager-to-Driver Connection.

Two models for database access are supported by the JDBC API. They are
the two-tier model and the three-tier model.

The two-tier model


In the two-tier model, a Java applet or application talks directly to the
database. This requires a JDBC driver that can communicate with the
particular database management system (DBMS) being accessed. SQL
statements are delivered to the database, and the results are sent back to the
user.

11

This is referred to as a client/server configuration, in which the users


machine is the client and the machine housing the database is the server.
The database may be located on another machine to which the user is
connected via a network.

The three-tier model


In the three-tier model, commands are sent to a middle tier of services,
which then send SQL statements to the database. The database processes
the SQL statements and sends the results back to the middle tier, which
then sends them to the user.

12

DATABASE DESIGN
The general theme behind a database is to handle information as an
integrated whole. A database is a collection of interrelated data stored with
minimum redundancy to serve many users quickly and effectively. After
designing the input and output, the analyst must concentrate on database
design or how data should be organized around user requirements. The
general objective is to make information access, easy quick, inexpensive
13

and flexible for other users. During database design the following
objectives are concerned: Controlled Redundancy
Easy to learn and use
More information and low cost
Accuracy
Integrity

ABOUT MS-ACCESS
Access is a relational database program .Access is used to enter, edit,
and analyze lists of data. Relational databases minimize redundant data.
Advantages of Access are as Follows:
Duplicate data is minimized
Information is more accurate
Data entry is faster and easier
14

Information can be viewed and sorted in multiple ways.


Information is more secure
Information can be shared among several users
Information retrieval is faster and easier

HOW TO CREATE THE DATABASE


The steps are as follows:

Click on the start button and open the MS-ACCESS.


Click on File menu->>New.
From New select Blank Access Database .
Type the name of the database in File name box (e.g Exam Suite)
and click on the Create button.
Then open the Database window and for create the table select the
Create table in Design view which is shown below:

15

Now create table question , registration , result as shown in fig


below:

16

Design view of question table is shown below:

TABLES USED
Name: Question
17

Primary key: scode, qno


Fieldname
Type

Size

scode
qno
qdesc
Choice1
Choice2
Choice3
answer

5
5
25
30
30
30
30

Text
Number
Text
Text
Text
Text
Text

Datasheet view of question table is shown below:

Design view of registration table is shown below:

18

TABLES USED
Name: Registration
Primary key: Email
Fieldname
Email
Fname
Lname
Dob
Quali
Ph
password

Type
Text
Text
Text
Number
Text
Number
Text

Size
5
5
25
10
15
15
10

Datasheet view of registration table is shown below:


19

Design view of result table is shown below:

TABLES USED
20

Name: Result
Fieldname
Email
Exam
Percent
Status

Type
Text
Text
Number
Text

Size
20
10
5
10

Datasheet view of result table is shown below:

HOW TO CONNECT WITH DATABASE


21

Domain

: Exam Suite

Front-end : Java
Back-end

: MS Access 2003

Before you compile the project you have to set the ODBC connection
then only it will work properly
Let us see How to set ODBC connection (MS Access)
1. Click Start button +Click Settings

2. Click Control Panel


22

2. Select Administrative tools + Click data Sources (ODBC)

23

4. Then you get ODBC Data Source Administrator window (shown


below) +Click Add Button

5. Create New Data Source (shown below) +select Microsoft Access


Driver (*.mdb,*.accdb) + press Finish button

24

6. ODBC Microsoft Access Set up (shown below) + gives Data Source


Name +select Database (Press select button) +select your database
(shown below) + Press Ok button

7. Before you close the window make sure that your DSN name is
correct or not (shown below) +Press Ok button

Now you got the DSN name (ExamSuite)This is the way for connecting ODBC
you have any doubt please mail us.
25

SOURCE CODE
LogFom.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
class LogFom extends JFrame implements ActionListener
{
JLabel lnl,pwl,ch,ch1,nusr;
JTextField lnt;
JPasswordField pwt;
JButton ok,can,btnr;
Container c;
String ln,psw;
Connection conn;
PreparedStatement pstmt;
public void setup()
{
c=getContentPane();
resize(350,230);
Dimension d=size();
setLocation(d.width,d.height);
setTitle("Multiple Choice Questions");
c.setLayout(null);
lnl=new JLabel("LOGIN EMAIL");
lnt=new JTextField();
lnl.setBounds(20,20,80,30);
lnt.setBounds(150,20,180,30);
pwl=new JLabel("PASSWORD");
pwt=new JPasswordField();
26

pwl.setBounds(20,70,80,30);
pwt.setBounds(150,70,180,30);
ok=new JButton("OK");
ok.setBounds(50,120,100,30);
can=new JButton("CANCEL");
can.setBounds(180,120,100,30);
nusr=new JLabel("For new user please ");
nusr.setBounds(140,165,150,30);
btnr=new JButton("Sign up");
btnr.setBounds(255,169,77,20);
c.add(lnl);
c.add(lnt);
c.add(pwl);
c.add(pwt);
c.add(ok);
c.add(can);
c.add(nusr);
c.add(btnr);
ok.addActionListener(this);
can.addActionListener(this);
btnr.addActionListener(this);
setVisible(true);
}
public void actionPerformed(ActionEvent ae)
{
String s=ae.getActionCommand();
27

if(s.equals("OK"))
{
try
{
pstmt = conn.prepareStatement("select * from registration");
ln=lnt.getText();
System.out.println("ln1 "+ln);
psw=pwt.getText();
System.out.println("psw "+psw);
ResultSet rs=pstmt.executeQuery();
int flag=0;
while(rs.next())
{
String one=rs.getString("email");
String two=rs.getString("password");
if(ln.equals(one) && psw.equals(two))
{
flag=1;
SelectExam ru=new SelectExam(one);
ru.setUp();
setVisible(false);
dispose();
}
}
if(flag==0)
{
JOptionPane.showMessageDialog (this, "Invalid User name or
Password.",
"Exam Suite
"JOptionPane.PLAIN_MESSAGE);
lnt.setText("");
pwt.setText("");
28

}
}
catch(SQLException e)
{
System.out.println("sql exception");
}
}
if(s.equals("CANCEL"))
{
System.exit(0);
}
if(s.equals("Sign up"))
{
new SignUp().setUp();
setVisible(false);
}
}
LogFom()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:ExamSuite","","");
}
catch(ClassNotFoundException e)
{
System.out.println("class not exception");
}
catch(SQLException e)
{
System.out.println("sql exception");
}
29

this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String args[])
{
LogFom lf=new LogFom();
lf.setup();
}
}

OUTPUT:

30

SignUp.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class SignUp extends JFrame implements ActionListener
{
JLabel jlb,jlfna,jllna,jldob,jlqu,jlph,jlpw,jlem;
JTextField jtfna,jtlna,jtdob,jtqu,jtph,jtem;
JPasswordField jtpw;
JButton jbsav,jblog;
Container c;
Connection conn;
PreparedStatement pstmt;
SignUp()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:ExamSuite","","");
}
catch(ClassNotFoundException e)
{
System.out.println("class not exception");
}
catch(SQLException e)
{
System.out.println("sql exception");
}
31

this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void setUp()
{
c=getContentPane();
setSize(900,700);
setTitle("Multiple Choice Questions ");
c.setBackground(Color.white);
c.setLayout(null);
jlb=new JLabel(new ImageIcon("Slide1.jpg"));
jlb.setBounds(0,0,900,120);
jlfna=new JLabel("First Name");
jlfna.setBounds(260,170,120,30);
jtfna=new JTextField();
jtfna.setBounds(440,170,120,30);
jllna=new JLabel("Last Name");
jllna.setBounds(260,230,120,30);
jtlna=new JTextField();
jtlna.setBounds(440,230,120,30);
jldob=new JLabel("Date of Birth");
jldob.setBounds(260,290,120,30);
jtdob=new JTextField();
jtdob.setBounds(440,290,120,30);
jlqu=new JLabel("Qualification");
jlqu.setBounds(260,350,120,30);
32

jtqu=new JTextField();
jtqu.setBounds(440,350,120,30);
jlph=new JLabel("Phone No.");
jlph.setBounds(260,410,120,30);
jtph=new JTextField();
jtph.setBounds(440,410,120,30);
jlem=new JLabel("E mail");
jlem.setBounds(260,470,120,30);
jtem=new JTextField();
jtem.setBounds(440,470,120,30);
jlpw=new JLabel("Password");
jlpw.setBounds(260,530,120,30);
jtpw=new JPasswordField();
jtpw.setBounds(440,530,120,30);
jbsav=new JButton("Save");
jbsav.setBounds(260,590,100,30);
jblog=new JButton("Go to Login");
jblog.setBounds(460,590,100,30);
c.add(jlb);
c.add(jlfna);
c.add(jtfna);
c.add(jllna);
c.add(jtlna);
c.add(jldob);
c.add(jtdob);
33

c.add(jlqu);
c.add(jtqu);
c.add(jlph);
c.add(jtph);
c.add(jlem);
c.add(jtem);
c.add(jlpw);
c.add(jtpw);
c.add(jbsav);
c.add(jblog);
jbsav.addActionListener(this);
jblog.addActionListener(this);
setVisible(true);
}
public void actionPerformed(ActionEvent ae)
{
String s=ae.getActionCommand();
Object obj=ae.getSource();
String email=new String(" ");
if(s.equals("Save"))
{
try
{
pstmt=conn.prepareStatement("insert into registration
values(?,?,?,?,?,?,?)");
String fname=jtfna.getText();
pstmt.setString(2,fname);
String lname=jtlna.getText();
pstmt.setString(3,lname);
String dob=jtdob.getText();
pstmt.setString(4,dob);
34

String qual=jtqu.getText();
pstmt.setString(5,qual);
String ph=jtph.getText();
pstmt.setString(6,ph);
email=jtem.getText();
pstmt.setString(1,email);
String pw=jtpw.getText();
pstmt.setString(7,pw);
pstmt.executeUpdate();
}
catch(SQLException se)
{
JOptionPane.showMessageDialog (this, "Error in saving the file",
"Exam Suite - SQL Error", JOptionPane.PLAIN_MESSAGE);
}
JOptionPane.showMessageDialog (this, "Successful Registration ",
"Exam Suite ", JOptionPane.PLAIN_MESSAGE);
jtfna.setText("");
jtlna.setText("");
jtdob.setText("");
jtqu.setText("");
jtph.setText("");
jtem.setText("");
jtpw.setText("");
}
if(s.equals("Go to Login"))
{
new LogFom().setup();
setVisible(false);
}
}
public static void main(String args[])
35

{
SignUp rt=new SignUp();
rt.setUp();
}
}

OUTPUT:

SelectExam.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
36

import java.sql.*;
public class SelectExam extends JFrame implements ActionListener
{
JPanel jpl = new JPanel();
JLabel lbse,jlqn,jlqd,jlb;
JTextField jtex;
JComboBox jcbse;
JRadioButton jone,jtwo,jthree;
ButtonGroup g = new ButtonGroup();
JButton jbse,jbse1;
Container c;
Connection conn;
PreparedStatement pstmt;
int qn=0,count=0,ans=0;
String com="empty",seven="empty",email,exam;
SelectExam(String eml)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:ExamSuite","","");
}
catch(ClassNotFoundException e)
{
System.out.println("class not exception");
}
catch(SQLException e)
{
System.out.println("sql exception");
}
email=eml;
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
37

}
public void setUp()
{
c=getContentPane();
setSize(900,700);
setTitle("Multiple Choice Questions");
c.setBackground(Color.white);
c.setLayout(null);
jlb=new JLabel(new ImageIcon(((new
ImageIcon("Slide1.jpg")).getImage()).getScaledInstance(1000, 90,
java.awt.Image.SCALE_SMOOTH)));
jlb.setBounds(0,0,900,120);
lbse=new JLabel("Select an Exam:");
lbse.setBounds(240,150,140,30);
String se[]={"C","C++","Java"};
jcbse=new JComboBox(se);
jcbse.setBounds(350,150,120,30);
jtex=new JTextField();
jtex.setBounds(350,150,120,30);
jbse=new JButton("Continue");
jbse.setBounds(500,150,100,30);
jlqn=new JLabel(" ");
jlqn.setBounds(255,235,30,30);
jlqd=new JLabel(" ");
jlqd.setBounds(280,235,600,30);
38

jone = new JRadioButton("",false);


jone.setBounds(280,275,600,25);
jone.setBackground(Color.white);
jtwo = new JRadioButton("",false);
jtwo.setBounds(280,295,600,25);
jtwo.setBackground(Color.white);
jthree = new JRadioButton("",false);
jthree.setBounds(280,315,600,25);
jthree.setBackground(Color.white);
g.add(jone);g.add(jtwo);g.add(jthree);
jbse1=new JButton("Next");
jbse1.setBounds(350,600,100,30);
c.add(jlb);
c.add(lbse);
c.add(jcbse);
c.add(jtex);
c.add(jbse);
c.add(jlqn);
c.add(jlqd);
c.add(jbse1);
jbse.addActionListener(this);
jbse1.addActionListener(this);
jone.addActionListener(this);
jtwo.addActionListener(this);
jthree.addActionListener(this);
setVisible(true);
jbse1.setVisible(false);
jtex.setVisible(false);
39

}
public void actionPerformed(ActionEvent ae)
{
String s=ae.getActionCommand();
Object obj=ae.getSource();
if(s.equals("Continue"))
{
try
{
pstmt=conn.prepareStatement("select * from question where scode= ?");
exam=""+jcbse.getSelectedItem();
pstmt.setString(1,exam);
ResultSet rs=pstmt.executeQuery();
while(rs.next())
{
jbse1.setVisible(true);
jlqd.setText("To start Exam please click the next button");
count++;
}
System.out.println(count);
}
catch(SQLException e)
{
System.out.println("sql exception");
}
jbse.setVisible(false);
jtex.setVisible(true);
jtex.setText(" "+jcbse.getSelectedItem());
jtex.setEditable(false);
jcbse.setVisible(false);
}
40

if(s.equals("Next"))
{
c.add(jone);
c.add(jtwo);
c.add(jthree);
jone.setSelected(false);
jtwo.setSelected(false);
jthree.setSelected(false);
if(com.equals("empty") || seven.equals("empty"))
{
}
else if(com.equals(seven))
{
ans++;
System.out.println("Continue: "+ans);
}
qn=qn+1;
if(qn<=count)
{
try
{
pstmt=conn.prepareStatement("select * from question where scode= ?
AND qno=?");
String sc=""+jcbse.getSelectedItem();
pstmt.setString(1,sc);
pstmt.setString(2,""+qn);
System.out.println("SC "+sc);
ResultSet rs=pstmt.executeQuery();
while(rs.next())
{
String one=rs.getString("scode");
41

String two=rs.getString("qno");
String three=rs.getString("qdesc");
String four=rs.getString("choice1");
String five=rs.getString("choice2");
String six=rs.getString("choice3");
seven=rs.getString("answer");
System.out.println("Answers: "+seven);
jlqn.setText(two);
jlqd.setText(three);
jone.setText(four);
jtwo.setText(five);
jthree.setText(six);
System.out.println(one);
System.out.println(two);
System.out.println(three);
System.out.println(four);
System.out.println(five);
System.out.println(six);
}
}
catch(SQLException e)
{
System.out.println("sql exception");
}
}
else
{
String elig;
if(ans>=5)
elig="Eligible";
else
elig="Not Eligible";
42

try
{
pstmt=conn.prepareStatement("insert into result values(?,?,?,?)");
pstmt.setString(1,email);
pstmt.setString(2,exam);
pstmt.setString(3,""+ans+"0");
pstmt.setString(4,elig);
pstmt.executeUpdate();
}
catch(SQLException se)
{
JOptionPane.showMessageDialog (this, "Error in saving the data",
"Exam Suite - SQL Error", JOptionPane.PLAIN_MESSAGE);
}
Result r = new Result(email,exam,ans,elig);
r.setUp();
setVisible(false);
dispose();
}
}
if(obj==jone)
{
com=jone.getText();
System.out.println(com);
}
if(obj==jtwo)
{
com=jtwo.getText();
System.out.println(com);
}
if(obj==jthree)
43

{
com=jthree.getText();
System.out.println(com);
}
}
}

OUTPUT:

44

Result.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class Result extends JFrame implements ActionListener
{
JLabel jlb,jlna,jlex,jlpr,jlst,res;
JTextField jtna,jtex,jtpr,jtst;
JButton jbexit,jbhm;
Container c;
Connection conn;
PreparedStatement pstmt;
String email,exam,fn,ln,name,per,st,el;
int an;
Result(String eml,String ex,int ans, String elig)
{
email=eml;
exam=ex;
an=ans;
el=elig;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:ExamSuite","","");
pstmt=conn.prepareStatement("select * from registration where email= ?");
45

pstmt.setString(1,email);
ResultSet rs=pstmt.executeQuery();
while(rs.next())
{
fn=rs.getString("fname");
ln=rs.getString("lname");
}
}
catch(ClassNotFoundException e)
{
System.out.println("class not exception");
}
catch(SQLException e)
{
System.out.println("sql exception");
}
name=fn+" "+ln;
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public void setUp()
{
c=getContentPane();
setSize(900,700);
setTitle("Multiple Choice Questions");
c.setBackground(Color.white);
c.setLayout(null);
jlb=new JLabel(new ImageIcon("Slide1.jpg"));
jlb.setBounds(0,0,900,120);
46

res=new JLabel("RESULT");
res.setBounds(400,150,120,30);
jlna=new JLabel("Name");
jlna.setBounds(260,230,120,30);
jtna=new JTextField(name);
jtna.setBounds(440,230,120,30);
jlex=new JLabel("Exam");
jlex.setBounds(260,290,120,30);
jtex=new JTextField(exam);
jtex.setBounds(440,290,120,30);
jlpr=new JLabel("Percentage");
jlpr.setBounds(260,350,120,30);
jtpr=new JTextField(an+"0%");
jtpr.setBounds(440,350,120,30);
jlst=new JLabel("Status");
jlst.setBounds(260,410,120,30);
jtst=new JTextField(el);
jtst.setBounds(440,410,120,30);
jbexit=new JButton("Exit");
jbexit.setBounds(260,500,100,30);
jbhm=new JButton("Logout");
jbhm.setBounds(460,500,100,30);
47

c.add(res);
c.add(jlb);
c.add(jlna);
c.add(jtna);
c.add(jlex);
c.add(jtex);
c.add(jlpr);
c.add(jtpr);
c.add(jlst);
c.add(jtst);
c.add(jbexit);
c.add(jbhm);
jbexit.addActionListener(this);
jbhm.addActionListener(this);
setVisible(true);
}
public void actionPerformed(ActionEvent ae)
{
String s=ae.getActionCommand();
if(s.equals("Exit"))
System.exit(0);
if(s.equals("Logout"))
{
new LogFom().setup();
setVisible(false);
48

dispose();
}
}
}

OUTPUT:

FULL WORKING AND IMPLEMENTATION OF PROJECT


Multiple Choice Questions : Login

49

Multiple Choice Questions : SignUp

Multiple Choice Questions : Login

50

Multiple Choice Questions : Select Exam

Multiple Choice Questions : Start Exam


51

Multiple Choice Questions : Exam

Multiple Choice Questions : Exam


52

Multiple Choice Questions : Exam

Multiple Choice Questions : Result


53

54

55

Anda mungkin juga menyukai