Java Microproject
Java Microproject
Java Microproject
A MICRO-PROJECT REPORT
ON
PROGRAM CODE:- CO 4 I
COURSE NAME:- Java programming
Course code:-22412
(2020-2021)
47 AmarShewale
48 Nikita shinde
49 Kaustubh shivnekar
1
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
INDEX
Report (Part A)
Sr.no Topic Page No
1 Title of the project
2 Introduction of project
8 Conclusion
9 Refrences
2
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
PART A
ANNEXURE 1
3
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
Action Plan:
Course: Microprocessor
4
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
46 SOHAIL SHAIKH
47 AmarShewale
48 Nikita shinde
49 Kaustubh shivnekar
5
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
PROGRAM CODE:-
for(int i=0;i<5;i++)
/*Online Java Paper Test*/ {
import java.awt.*; jb[i]=new JRadioButton();
import java.awt.event.*; add(jb[i]);
import javax.swing.*; bg.add(jb[i]);
class OnlineTest extends JFrame }
implements ActionListener
b1=new JButton("Next");
{
b2=new JButton("Bookmark");
JLabel l;
b1.addActionListener(this);
JRadioButton jb[]=new
b2.addActionListener(this);
JRadioButton[5];
add(b1);add(b2);
JButton b1,b2;
set();
ButtonGroup bg;
l.setBounds(30,40,450,20);
int
count=0,current=0,x=1,y=1,now=0; jb[0].setBounds(50,80,100,20);
OnlineTest(String s) jb[2].setBounds(50,140,100,20);
{ jb[3].setBounds(50,170,100,20);
super(s); b1.setBounds(100,240,100,30);
6
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
setLocation(250,100); bk.setBounds(480,20+30*x,100,30);
setVisible(true); add(bk);
setSize(600,350); bk.addActionListener(this);
} m[x]=current;
public void x++;
actionPerformed(ActionEvent e)
current++;
{
set();
if(e.getSource()==b1
if(current==9)
{
b2.setText("Result");
if(check())
setVisible(false);
count=count+1;
setVisible(true);
current++; set();
}
if(current==9)
for(int i=0,y=1;i<x;i++,y++)
{
{
b1.setEnabled(false);
b2.setText("Result"); if(e.getActionCommand().equals("Bo
okmark"+y))
}
{
}
if(check())
if(e.getActionCommand().equals("Bo count=count+1;
okmark"))
now=current;
{
current=m[y];
JButton bk=new
set();
JButton("Bookmark"+x);
7
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
if(e.getActionCommand().equals("Res }
ult")) if(current==1)
{ {
if(check()) l.setText("Que2: Which class is
count=count+1; available to all the class
automatically");
current++;
jb[0].setText("Swing");jb[1].setText("
//System.out.println("correct Applet");jb[2].setText("Object");jb[3]
ans="+count); .setText("ActionEvent");
}
JOptionPane.showMessageDialog(thi
s,"correct ans="+count); if(current==2)
System.exit(0); {
} l.setText("Que3: Which package is
directly available to our class without
}
importing it");
void set()
{ jb[0].setText("swing");jb[1].setText("
applet");jb[2].setText("net");jb[3].set
jb[4].setSelected(true);
Text("lang");
if(current==0)
}
{
8
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
if(current==3) {
{ l.setText("Que7: Which one among
these is not a class ");
l.setText("Que4: String class is
defined in which package");
jb[0].setText("Swing");jb[1].setText("
Actionperformed");jb[2].setText("Ac
jb[0].setText("lang");jb[1].setText("S
tionEvent");jb[3].setText("B utton");
wing");jb[2].setText("Applet");jb[3].s
etText("awt"); }
} if(current==7)
if(current==4) {
{ l.setText("Que8: which one among
these is not a function of Object
l.setText("Que5: Which institute is
class");
best for java coaching");
jb[0].setText("Utek");jb[1].setText("A
ptech");jb[2].setText("SSS jb[0].setText("toString");jb[1].setText
IT");jb[3].setText("jtek"); ("finalize");jb[2].setText("equals");jb[
3].setText("getDocumentB ase");
}
}
if(current==5)
if(current==8) { l.setText("Que9:
{ which function is not present in
l.setText("Que6: Which one among Applet class");
these is not a keyword");
jb[0].setText("init");jb[1].setText("ma
jb[0].setText("class");jb[1].setText("i in");jb[2].setText("start");jb[3].setTex
nt");jb[2].setText("get");jb[3].setText t("destroy");
("if"); } }
if(current==6) if(current==9)
9
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
{ if(current==5)
l.setText("Que10: Which one among return(jb[2].isSelected());
these is not a valid component");
if(current==6)
jb[0].setText("JButton");jb[1].setText return(jb[1].isSelected());
("JList");jb[2].setText("JButtonGroup" if(current==7)
);jb[3].setText("JTextArea ");
return(jb[3].isSelected());
}
if(current==8)
l.setBounds(30,40,450,20); for(int
return(jb[1].isSelected());
i=0,j=0;i<=90;i+=30,j++)
if(current==9)
jb[j].setBounds(50,80+i,200,20);
return(jb[2].isSelected());
}
return false;
boolean check()
}
{
public static void main(String s[])
if(current==0)
{
return(jb[1].isSelected());
new OnlineTest("Online Test Of
if(current==1)
Java");
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());
10
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
OUTPUT:
11
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
12
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
13
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
14
INSTITUTE OF TECHNOLOGY, HADAPSAR, PUNE.
15