0% found this document useful (0 votes)
12 views

Java PDF

bla

Uploaded by

vanshbosssrahate
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Java PDF

bla

Uploaded by

vanshbosssrahate
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Advance Java Micro Project

QUIZ APPLICATION DEVELOPEMENT


Introduction

The ‘MCQ Quiz Application’ project will be developed to overcome the


time consuming problem of manual system. Apart from that in current
system, checking the answer sheets after taking test, waste the examiners
time, so this application will check the correct answer and save the examiner
time and carry the examination in an effective manner. The users which are
use this system don’t need to high computing knowledge and also system
will inform them while entering invalid data.
The aim of this project is to computerized the existing manual system and
help the examiners to save their valuable time and important data. Apart
from this, data which are exist in this system, will exist for long period of
time and will be easy accessible. This project helps the examiners to manage
their services in a good way and provide a better service to their users. The
project will reduce the manual process in managing examinations and all
issues regarding that.

Functionalities of the project will be as following:

o Able the examiners to punch the MCQ questions ;


o Able the users to solve the questions ;
o Examiners can manage the information regarding exam;
o Correct answers will be evaluated by system (First it should be
determining by examiner);
o Users can see their result after submitting the test.

PAGE 1
To design and implement this project we plan that the project support to
different types of users apart from its administrative part. When project is
run for the first time it allowed attempting the test and submitting that user
will receive a message that you have attempt the test successfully and if the
user tries to attempt the same test, system will not allow him/her.
To conclude introduction, we have use these modules to follow the
objectives of our project and each of these modules have logical connections
to other modules which they are depend.

➢ Attempt Test:

➢ Marks: Which able the particular students to have access to result of


the test attempt.

Methodology

The methodology of developing of project will be a step-by-step sequence


to design, develop and deliver the application. In software engineering this
methodology called ‘waterfall model’ which one portion of work follows
after another in a linear sequence. Following steps will be followed in this
methodology:

▪ Initiation (Requirement Specification);


▪ Planning and design;
▪ Execution (construction and coding);
▪ Validation (Testing);
▪ Closure (Installation and Maintenance).

PAGE 2
Project Design

For designing and implementing of MCQ Quiz application we used Applet &
Swing.

1. 1st prompt massage :-

2. Main home screen and display 1st question and next 9 question :-
3. Result :-
Coding

/*Java Quiz Test*/

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

class OnlineTest extends JFrame implements ActionListener


{
JLabel l;
JRadioButton jb[]=new JRadioButton[5];
JButton b1,b2;
ButtonGroup bg;
int count=0,current=0,x=1,y=1,now=0;
int m[]=new int[10];
OnlineTest(String s)
{
super(s);

JOptionPane.showMessageDialog(this,"Wel-Come to Java Quiz!


Click Ok to Proceed!... All The Best... ");
l=new JLabel();
add(l);
bg=new ButtonGroup();
for(int i=0;i<5;i++)
{
jb[i]=new JRadioButton();
add(jb[i]);
bg.add(jb[i]);
}
b1=new JButton("Next");
b2=new JButton("Bookmark");
b1.addActionListener(this);

PAGE 5
b2.addActionListener(this);
add(b1);add(b2);
set();
l.setBounds(30,40,650,20);
jb[0].setBounds(50,80,100,20);
jb[1].setBounds(50,110,100,20);
jb[2].setBounds(50,140,100,20);
jb[3].setBounds(50,170,100,20);
b1.setBounds(100,240,100,30);
b2.setBounds(270,240,100,30);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(null);
setLocation(550,300);
setVisible(true);
setSize(750,350);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
if(check())
count=count+1;
current++;
set();
if(current==9)
{
b1.setEnabled(false);
b2.setText("Result");
}
}
if(e.getActionCommand().equals("Bookmark"))
{
JButton bk=new JButton("Bookmark"+x);
bk.setBounds(480,20+30*x,100,30);
add(bk);
bk.addActionListener(this);
m[x]=current;
x++;
current++;

PAGE 6
set();
if(current==9)
b2.setText("Result");
setVisible(false);
setVisible(true);
}
for(int i=0,y=1;i<x;i++,y++)
{
if(e.getActionCommand().equals("Bookmark"+y))
{
if(check())
count=count+1;
now=current;
current=m[y];
set();
((JButton)e.getSource()).setEnabled(false);
current=now;
}
}

if(e.getActionCommand().equals("Result"))
{
if(check())
count=count+1;
current++;

JOptionPane.showMessageDialog(this,"correct
ans="+count);
JOptionPane.showMessageDialog(this,"Thank You!");
System.exit(0);
}
}

void set()
{
jb[4].setSelected(true);
if(current==0)
{

PAGE 7
l.setText("Q.1: Which is a component in AWT that can contain
another components like buttobs, textfields, lables, etc.?");

jb[0].setText("Window");jb[1].setText("Container");jb[2].setText("Pa
nel");jb[3].setText("Fream");
}
if(current==1)
{
l.setText("Q.2: Swing is based on ______ architecture.");
jb[0].setText("layered");jb[1].setText("client
server");jb[2].setText("model view controller");jb[3].setText("none of
these");
}
if(current==2)
{
l.setText("Q.3: In swing JButton class derived from _____.");
jb[0].setText("none of
these");jb[1].setText("JComponent");jb[2].setText("JToggleButton");jb[3].se
tText("AbstractButton");
}
if(current==3)
{
l.setText("Q.4: Which of these packages contains all the event
handling interface?");

jb[0].setText("java.awt.event");jb[1].setText("java.lang");jb[2].setTex
t("java.awt");jb[3].setText("java.event");
}
if(current==4)
{
l.setText("Q.5: Which of these methods will be invoked if a charater
is entered?");

jb[0].setText("KeyPressed()");jb[1].setText("KeyReleased()");jb[2].se
tText("KeyTyped()");jb[3].setText("KeyEntered()");
}
if(current==5)
{
l.setText("Q.6: Which package contains the classes & interfaces
required for java networking?");

jb[0].setText("java.io");jb[1].setText("java.util");jb[2].setText("java.n
et");jb[3].setText("java.awt");
}
if(current==6)
{
l.setText("Q.7: JDBC stands for _______. ");
jb[0].setText("Java Database
Control");jb[1].setText("Java Database Conectivity");jb[2].setText("Java
Database Components");jb[3].setText("None of these");
}
if(current==7)
{
l.setText("Q.8: Java applet are used to create ______.");
jb[0].setText("graphical");jb[1].setText("user
interactive");jb[2].setText("none of these");jb[3].setText("both (a) & (b)");

}
if(current==8)
{
l.setText("Q.9: Which object can be constructed to show any number
of choices in the visible window?");

jb[0].setText("Choice");jb[1].setText("List");jb[2].setText("Menu");jb
[3].setText("Checbox");
}
if(current==9)
{
l.setText("Q.10: Following letter used as a prefix to swing
component.");

jb[0].setText("A");jb[1].setText("G");jb[2].setText("J");jb[3].setText(
"S");
}
l.setBounds(30,40,650,20);
for(int i=0,j=0;i<=90;i+=30,j++)
jb[j].setBounds(50,80+i,200,20);
}
boolean check()
{
if(current==0)
return(jb[1].isSelected());
if(current==1)
return(jb[2].isSelected());
if(current==2)
return(jb[3].isSelected());
if(current==3)
return(jb[0].isSelected());
if(current==4)
return(jb[2].isSelected());
if(current==5)
return(jb[2].isSelected());
if(current==6)
return(jb[1].isSelected());
if(current==7)
return(jb[3].isSelected());
if(current==8)
return(jb[1].isSelected());
if(current==9)
return(jb[2].isSelected());
return false;
}
public static void main(String s[])
{
new OnlineTest("Online Java Test");
}

PAGE 10
Screen Shot :-

You might also like