Menu Bar

Horizontal Scrollable Menu

Search This Blog

online quiz java gui project with complete source code

https://www.myprogrammingschool.com/search/label/Java_Projectonline quiz java gui project



Source code


/* 
online quiz java gui project with complete source code

This is main page or Home page where you can start you Quiz there before to start this you  have to enter your name and roll-number then only you can start other wise it will display data missing messing 
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Quiz implements ActionListener
{
JFrame f;
JLabel l1,l2,l3,l4,l5,l6;
JTextField t1,t2;
JButton b1,b2,b3,b4;
Quiz()
{
f=new JFrame("ONLINE QUIZ");
f.getContentPane().setBackground(Color.magenta);
f.setVisible(true);
f.setSize(1500,1500);
//f.setBackground(Color.blue);
f.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
JLabel ll=new JLabel(new ImageIcon("mits1.JPEG"));
l1=new JLabel("MY PROGRAMMING SCHOOL");
b1=new JButton("WELCOME TO ONLINE QUIZ");
b2=new JButton("Instructions");
l2=new JLabel("NAME");
t1=new JTextField(10);
l3=new JLabel("ROLL NUM");
t2=new JTextField(10);
b3=new JButton("start");
b4=new JButton("cancel");
l4=new JLabel("1.Each question carry 5 marks.");
l5=new JLabel("3.No negative marks.");
l6=new JLabel("2.You can select only one option from A to D.");
//b1.setForeground(Color.[255,20,147]);
b1.setBackground(Color.yellow);
b3.setBackground(Color.cyan);
b4.setBackground(Color.gray);
l1.setFont(new Font("cooper",Font.BOLD,40));
b1.setFont(new Font("casteller",Font.BOLD,30));
b2.setFont(new Font("cooper",Font.BOLD,25));
b3.setFont(new Font("cooper",Font.BOLD,25));
b4.setFont(new Font("cooper",Font.BOLD,25));
l4.setFont(new Font("casteller",Font.BOLD,30));
l5.setFont(new Font("casteller",Font.BOLD,30));
l6.setFont(new Font("casteller",Font.BOLD,30));
l2.setFont(new Font("casteller",Font.BOLD,30));
l3.setFont(new Font("casteller",Font.BOLD,30));
f.add(ll);
f.add(l1);
f.add(b1);
f.add(b2);
f.add(l4);
//f.add(l5);
f.add(l6);
f.add(l2);
f.add(t1);
f.add(l3);
f.add(t2);
f.add(b3);
f.add(b4);
b3.addActionListener(this);
b4.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b3))
{
try
{String s1=t1.getText();
String s2=t2.getText();
if(t1.getText().equals(""))
{JOptionPane.showMessageDialog(null,"Enter candidate name");}
else if(t2.getText().equals(""))
{JOptionPane.showMessageDialog(null,"Enter Roll num");}

else
{f.setVisible(false);
new Page1(f,s1,s2);
}
}
finally
{}

}
else
{
f.setVisible(false);
}
}
public static void main(String...aaa)
{
new Quiz();
}

}



/*

when we click on start button then it will display new page where you will get different group from 1 to 10
then at once you can click only one then perform solution 

*/

class Page1 implements ActionListener
{int m=0;
JFrame f1,p;
JRadioButton b1,b2,b3,b4,b5,b6,b7,b8,b9,b10;
JLabel l1;
JButton b11;
String ss1,ss2;
Page1(JFrame f,String s1,String s2)
{
ButtonGroup g11=new ButtonGroup();
f1=f;
ss1=s1;
ss2=s2;
p=new JFrame("QUIZ");
p.setVisible(true);
p.setSize(1000,1000);
p.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
b1=new JRadioButton("Question 1");
b2=new JRadioButton("Question 2");
b3=new JRadioButton("Question 3");
b4=new JRadioButton("Question 4");
b5=new JRadioButton("Question 5");
b6=new JRadioButton("Question 6");
b7=new JRadioButton("Question 7");
b8=new JRadioButton("Question 8");
b9=new JRadioButton("Question 9");
b10=new JRadioButton("Question 10");
g11.add(b1);
g11.add(b2);
g11.add(b3);
g11.add(b4);
g11.add(b5);
g11.add(b6);
g11.add(b7);
g11.add(b8);
g11.add(b9);
g11.add(b10);
l1=new JLabel("Good Luck !!! You can proceed.");
l1.setFont(new Font("cooper",Font.BOLD,50));
b11=new JButton("SAVE and SUBMIT");
b11.setFont(new Font("cooper",Font.BOLD,35));
b1.setFont(new Font("casteller",Font.BOLD,30));
b2.setFont(new Font("casteller",Font.BOLD,30));
b3.setFont(new Font("casteller",Font.BOLD,30));
b4.setFont(new Font("casteller",Font.BOLD,30));
b5.setFont(new Font("casteller",Font.BOLD,30));
b6.setFont(new Font("casteller",Font.BOLD,30));
b7.setFont(new Font("casteller",Font.BOLD,30));
b8.setFont(new Font("casteller",Font.BOLD,30));
b9.setFont(new Font("casteller",Font.BOLD,30));
b10.setFont(new Font("casteller",Font.BOLD,30));
//p.setBackground(Color.pink);
p.add(l1);
p.add(b1);
p.add(b2);
p.add(b3);
p.add(b4);
p.add(b5);
p.add(b6);
p.add(b7);
p.add(b8);
p.add(b9);
p.add(b10);
p.add(b11);
b11.addActionListener(this);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
b6.addActionListener(this);
b7.addActionListener(this);
b8.addActionListener(this);
b9.addActionListener(this);
b10.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b1))
{
p.setVisible(false);
new Q1(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b2))
{
p.setVisible(false);
new Q2(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b3))
{
p.setVisible(false);
new Q3(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b4))
{
p.setVisible(false);
new Q4(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b5))
{
p.setVisible(false);
new Q5(p,m,f1,ss1,ss2);
}

if(ae.getSource().equals(b6))
{
p.setVisible(false);
new Q6(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b7))
{
p.setVisible(false);
new Q7(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b8))
{
p.setVisible(false);
new Q8(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b9))
{
p.setVisible(false);
new Q9(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b10))
{
p.setVisible(false);
new Q10(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b11))
{
p.setVisible(false);
JOptionPane.showMessageDialog(null,"Submitted Succesfully");
JOptionPane.showMessageDialog(null,"The candidate "+ss1+" with roll num "+ss2+"  score is::"+m);
}
}
public void marks(int m1)
{
m=m+m1;
}
}

/*

here you will get question and you have to select proper answer and then click on save and next button so you answer will save and it display next question then perform same operation with all 10 questions

*/

class Q1 implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q1(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 1");
ButtonGroup j=new ButtonGroup();
JLabel ll=new JLabel(new ImageIcon("ram.JPEG"));
l1=new JLabel("1.Where is RAM located?");
b1=new JRadioButton("Exception Board");
b2=new JRadioButton("External Drive");
b3=new JRadioButton("Mother Board");
b4=new JRadioButton("All of above");
b5=new JButton("Save and next");
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
q.add(ll);
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b3.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}
class Q2-implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q2(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 2");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("2.Which of the following are components of Central Processing Unit(CPU)?");
b1=new JRadioButton("Arithemetic logic unit,Mouse");
b2=new JRadioButton("Arithemetic logic unit,Control unit");
b3=new JRadioButton("Arithemetic logic unit,Integrated Circuits");
b4=new JRadioButton("Controlunit,Monitor");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("cpu.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,38));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b2.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}




class Q3-implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q3(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 3");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("3.Full form of URL is?");

b1=new JRadioButton("Uniform Resource Locator");
b2=new JRadioButton("Uniform Resource Link");
b3=new JRadioButton("Uniform Registered Link");
b4=new JRadioButton("Unified Resource Link");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("url.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));

q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
//q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b1.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}

class Q4-implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q4(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 4");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("4.Which of the following is used in RAM?");
b1=new JRadioButton("Conductor");
b2=new JRadioButton("Semi Conductor");
b3=new JRadioButton("Vaccum Tubes");
b4=new JRadioButton("Transistor");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("ram1.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b2.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}
class Q5-implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q5(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 5");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("5.Who was the founder of Bluetooth?");
b1=new JRadioButton("Ericson");
b2=new JRadioButton("Martin Cooper");
b3=new JRadioButton("Steve Jobs");
b4=new JRadioButton("Apple");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("blu.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b1.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}

class Q6-implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q6(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 6");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("6.Who was the father of Internet?");
b1=new JRadioButton("Chares Babbage");
b2=new JRadioButton("Vint Cerf");
b3=new JRadioButton("Denis Riche");
b4=new JRadioButton("Matin Cooper");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("i1.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b2.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}
class Q7-implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q7(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 7");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("7.What is LINUX?");
b1=new JRadioButton("Malware");
b2=new JRadioButton("Operating System");
b3=new JRadioButton("Application Program");
b4=new JRadioButton("Firmware");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("l0.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b2.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}
class Q8-implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q8(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 8");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("8.Which is most common language used designing?");
b1=new JRadioButton("C");
b2=new JRadioButton("C++");
b3=new JRadioButton("PHP");
b4=new JRadioButton("HTML");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("rr1.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b4.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}

class Q9-implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q9(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 9");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("9.What is the name of first super computer of India?");
b1=new JRadioButton("Saga 220");
b2=new JRadioButton("PARAM 8000");
b3=new JRadioButton("ENIAC");
b4=new JRadioButton("PARAM 6000");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("sc.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b2.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}


class Q10-implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q10(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 10");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("10.Verification is a process of?");
b1=new JRadioButton("Access");
b2=new JRadioButton("Login");
b3=new JRadioButton("Logout");
b4=new JRadioButton("Authentication");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("v1.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b4.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}

/*

After completed the Quiz it will display the result person name and roll number and it also display how many question you correct and what is your score
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class Quiz implements ActionListener
{
JFrame f;
JLabel l1,l2,l3,l4,l5,l6;
JTextField t1,t2;
JButton b1,b2,b3,b4;
Quiz()
{
f=new JFrame("ONLINE QUIZ");
f.getContentPane().setBackground(Color.magenta);
f.setVisible(true);
f.setSize(1500,1500);
//f.setBackground(Color.blue);
f.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
JLabel ll=new JLabel(new ImageIcon("mits1.JPEG"));
l1=new JLabel("MADANAPALLE INSTITUTE OF TECHNOLOGY AND SCIENCE");
b1=new JButton("WELCOME TO ONLINE QUIZ");
b2=new JButton("Instructions");
l2=new JLabel("NAME");
t1=new JTextField(10);
l3=new JLabel("ROLL NUM");
t2=new JTextField(10);
b3=new JButton("start");
b4=new JButton("cancel");
l4=new JLabel("1.Each question carry 5 marks.");
l5=new JLabel("3.No negative marks.");
l6=new JLabel("2.You can select only one option from A to D.");
//b1.setForeground(Color.[255,20,147]);
b1.setBackground(Color.yellow);
b3.setBackground(Color.cyan);
b4.setBackground(Color.gray);
l1.setFont(new Font("cooper",Font.BOLD,40));
b1.setFont(new Font("casteller",Font.BOLD,30));
b2.setFont(new Font("cooper",Font.BOLD,25));
b3.setFont(new Font("cooper",Font.BOLD,25));
b4.setFont(new Font("cooper",Font.BOLD,25));
l4.setFont(new Font("casteller",Font.BOLD,30));
l5.setFont(new Font("casteller",Font.BOLD,30));
l6.setFont(new Font("casteller",Font.BOLD,30));
l2.setFont(new Font("casteller",Font.BOLD,30));
l3.setFont(new Font("casteller",Font.BOLD,30));
f.add(ll);
f.add(l1);
f.add(b1);
f.add(b2);
f.add(l4);
//f.add(l5);
f.add(l6);
f.add(l2);
f.add(t1);
f.add(l3);
f.add(t2);
f.add(b3);
f.add(b4);
b3.addActionListener(this);
b4.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b3))
{
try
{String s1=t1.getText();
String s2=t2.getText();
if(t1.getText().equals(""))
{JOptionPane.showMessageDialog(null,"Enter candidate name");}
else if(t2.getText().equals(""))
{JOptionPane.showMessageDialog(null,"Enter Roll num");}

else
{f.setVisible(false);
new Page1(f,s1,s2);
}
}
finally
{}

}
else
{
f.setVisible(false);
}
}
public static void main(String...aaa)
{
new Quiz();
}

}





class Page1 implements ActionListener
{int m=0;
JFrame f1,p;
JRadioButton b1,b2,b3,b4,b5,b6,b7,b8,b9,b10;
JLabel l1;
JButton b11;
String ss1,ss2;
Page1(JFrame f,String s1,String s2)
{
ButtonGroup g11=new ButtonGroup();
f1=f;
ss1=s1;
ss2=s2;
p=new JFrame("QUIZ");
p.setVisible(true);
p.setSize(1000,1000);
p.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
b1=new JRadioButton("Question 1");
b2=new JRadioButton("Question 2");
b3=new JRadioButton("Question 3");
b4=new JRadioButton("Question 4");
b5=new JRadioButton("Question 5");
b6=new JRadioButton("Question 6");
b7=new JRadioButton("Question 7");
b8=new JRadioButton("Question 8");
b9=new JRadioButton("Question 9");
b10=new JRadioButton("Question 10");
g11.add(b1);
g11.add(b2);
g11.add(b3);
g11.add(b4);
g11.add(b5);
g11.add(b6);
g11.add(b7);
g11.add(b8);
g11.add(b9);
g11.add(b10);
l1=new JLabel("Good Luck !!! You can proceed.");
l1.setFont(new Font("cooper",Font.BOLD,50));
b11=new JButton("SAVE and SUBMIT");
b11.setFont(new Font("cooper",Font.BOLD,35));
b1.setFont(new Font("casteller",Font.BOLD,30));
b2.setFont(new Font("casteller",Font.BOLD,30));
b3.setFont(new Font("casteller",Font.BOLD,30));
b4.setFont(new Font("casteller",Font.BOLD,30));
b5.setFont(new Font("casteller",Font.BOLD,30));
b6.setFont(new Font("casteller",Font.BOLD,30));
b7.setFont(new Font("casteller",Font.BOLD,30));
b8.setFont(new Font("casteller",Font.BOLD,30));
b9.setFont(new Font("casteller",Font.BOLD,30));
b10.setFont(new Font("casteller",Font.BOLD,30));
//p.setBackground(Color.pink);
p.add(l1);
p.add(b1);
p.add(b2);
p.add(b3);
p.add(b4);
p.add(b5);
p.add(b6);
p.add(b7);
p.add(b8);
p.add(b9);
p.add(b10);
p.add(b11);
b11.addActionListener(this);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
b6.addActionListener(this);
b7.addActionListener(this);
b8.addActionListener(this);
b9.addActionListener(this);
b10.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b1))
{
p.setVisible(false);
new Q1(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b2))
{
p.setVisible(false);
new Q2(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b3))
{
p.setVisible(false);
new Q3(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b4))
{
p.setVisible(false);
new Q4(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b5))
{
p.setVisible(false);
new Q5(p,m,f1,ss1,ss2);
}

if(ae.getSource().equals(b6))
{
p.setVisible(false);
new Q6(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b7))
{
p.setVisible(false);
new Q7(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b8))
{
p.setVisible(false);
new Q8(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b9))
{
p.setVisible(false);
new Q9(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b10))
{
p.setVisible(false);
new Q10(p,m,f1,ss1,ss2);
}
if(ae.getSource().equals(b11))
{
p.setVisible(false);
JOptionPane.showMessageDialog(null,"Submitted Succesfully");
JOptionPane.showMessageDialog(null,"The candidate "+ss1+" with roll num "+ss2+"  score is::"+m);
}
}
public void marks(int m1)
{
m=m+m1;
}
}



class Q1 implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q1(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 1");
ButtonGroup j=new ButtonGroup();
JLabel ll=new JLabel(new ImageIcon("ram.JPEG"));
l1=new JLabel("1.Where is RAM located?");
b1=new JRadioButton("Exception Board");
b2=new JRadioButton("External Drive");
b3=new JRadioButton("Mother Board");
b4=new JRadioButton("All of above");
b5=new JButton("Save and next");
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
q.add(ll);
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b3.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}


class Q2 implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q2(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 2");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("2.Which of the following are components of Central Processing Unit(CPU)?");
b1=new JRadioButton("Arithemetic logic unit,Mouse");
b2=new JRadioButton("Arithemetic logic unit,Control unit");
b3=new JRadioButton("Arithemetic logic unit,Integrated Circuits");
b4=new JRadioButton("Controlunit,Monitor");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("cpu.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,38));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b2.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}




class Q3 implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q3(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 3");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("3.Full form of URL is?");

b1=new JRadioButton("Uniform Resource Locator");
b2=new JRadioButton("Uniform Resource Link");
b3=new JRadioButton("Uniform Registered Link");
b4=new JRadioButton("Unified Resource Link");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("url.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));

q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
//q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b1.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}







class Q4 implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q4(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 4");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("4.Which of the following is used in RAM?");
b1=new JRadioButton("Conductor");
b2=new JRadioButton("Semi Conductor");
b3=new JRadioButton("Vaccum Tubes");
b4=new JRadioButton("Transistor");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("ram1.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b2.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}





class Q5 implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q5(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 5");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("5.Who was the founder of Bluetooth?");
b1=new JRadioButton("Ericson");
b2=new JRadioButton("Martin Cooper");
b3=new JRadioButton("Steve Jobs");
b4=new JRadioButton("Apple");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("blu.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b1.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}

class Q6 implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q6(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 6");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("6.Who was the father of Internet?");
b1=new JRadioButton("Chares Babbage");
b2=new JRadioButton("Vint Cerf");
b3=new JRadioButton("Denis Riche");
b4=new JRadioButton("Matin Cooper");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("i1.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b2.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}





class Q7 implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q7(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 7");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("7.What is LINUX?");
b1=new JRadioButton("Malware");
b2=new JRadioButton("Operating System");
b3=new JRadioButton("Application Program");
b4=new JRadioButton("Firmware");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("l0.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b2.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}
class Q8 implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q8(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 8");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("8.Which is most common language used designing?");
b1=new JRadioButton("C");
b2=new JRadioButton("C++");
b3=new JRadioButton("PHP");
b4=new JRadioButton("HTML");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("rr1.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b4.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}




class Q9 implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q9(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 9");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("9.What is the name of first super computer of India?");
b1=new JRadioButton("Saga 220");
b2=new JRadioButton("PARAM 8000");
b3=new JRadioButton("ENIAC");
b4=new JRadioButton("PARAM 6000");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("sc.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b2.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}





class Q10 implements ActionListener
{int m1;
String sss1,sss2;
JFrame f2,q;
JLabel l1;
JRadioButton b1,b2,b3,b4;
JButton b5;
Q10(JFrame f,int m,JFrame f1,String ss1,String ss2)
{m1=m;
f2=f;
sss1=ss1;
sss2=ss2;
q=new JFrame("QUESTION 10");
ButtonGroup j=new ButtonGroup();
l1=new JLabel("10.Verification is a process of?");
b1=new JRadioButton("Access");
b2=new JRadioButton("Login");
b3=new JRadioButton("Logout");
b4=new JRadioButton("Authentication");
b5=new JButton("Save and next");
JLabel ll=new JLabel(new ImageIcon("v1.JPEG"));
l1.setFont(new Font("cooper",Font.BOLD,50));
b1.setFont(new Font("casteller",Font.BOLD,40));
b2.setFont(new Font("casteller",Font.BOLD,40));
b3.setFont(new Font("casteller",Font.BOLD,40));
b4.setFont(new Font("casteller",Font.BOLD,40));
b5.setFont(new Font("cooper",Font.BOLD,50));
q.setVisible(true);
q.setSize(1000,1000);
q.setLayout(new FlowLayout(FlowLayout.CENTER,2000,5));
j.add(b1);
j.add(b2);
j.add(b3);
j.add(b4);
q.add(ll);
q.add(l1);
q.add(b1);
q.add(b2);
q.add(b3);
q.add(b4);
q.add(b5);
b1.addActionListener(this);
b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);
b5.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource().equals(b5))
{
if(b4.isSelected())
m1=m1+5;
q.setVisible(false);
Page1 k=new Page1(f2,sss1,sss2);
k.marks(m1);
}
}
}









ads3