IGNOU Solved Question Paper BCSL-043 (JAVA PROGRAMMING LAB)
IGNOU Solved Question Paper BCSL-043 (JAVA PROGRAMMING LAB) in this website i will provide answers or solutions of
IGNOU BCSL-043
subject which is a java programming lab of BCA 4th semester subject. Java
Programming Lab is one of the important subjects you have to study in
BCA Programme. This subjects is the base language for any programming
languages who uses the OOPs Concepts (Object Oriented Programming) Such as
Php,Python,C#,.Net,etc... We gonna provide you the solution of question
paper of JUNE 2018 SET-3.
Let's see the question and answer of this set.
Solution:
import java.applet.Applet;
import java.awt.event.*;
import java.awt.Button;
import java.awt.Color;
import java.awt.Font;
import java.awt.TextField;
import java.awt.Label;
//<applet code = KmToM.class width = "500" height =
"700"></applet>
public class KmToM extends Applet implements ActionListener{
TextField t1,t2;
Label l1,l2,l3,l4;
Button b1,b2;
public void init()
{ setBackground(Color.ORANGE);
Font f = new Font("Verdana",Font.BOLD,12);
setFont(f);
l1 = new Label("Enter length of road-1 in metres");
l2 = new Label("Enter length of road-2 in metres");
t1 = new TextField();
t1.setBackground(Color.pink);
t2 = new TextField();
t2.setBackground(Color.pink);
l3 = new Label();
l4 = new Label();
l3.setForeground(Color.blue);
l4.setForeground(Color.blue);
b1 = new Button("Submit");
b2 = new Button("Submit");
setLayout(null);
l1.setBounds(50,50,180,40);
t1.setBounds(250,60,60,30);
b1.setBounds(330,60,60,30);
t2.setBounds(250,130,60,30);
l2.setBounds(50,120,180,40);
b2.setBounds(330,130,60,30);
l3.setBounds(50,200,250,40);
l4.setBounds(50,250,250,40);
add(t1);
add(t2);
add(l1);
add(l2);
add(l3);
add(l4);
add(b1);
add(b2);
b1.addActionListener(this);
b2.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
if(b1==ae.getSource())
{
float r1=Float.parseFloat(t1.getText());
l3.setText("Length of Road-1 in kilometres
is "+r1/1000+"km");
}
if(b2==ae.getSource())
{
float r2=Float.parseFloat(t2.getText());
l4.setText("Length of Road-2 in kilometres
is "+r2/1000+"km");
}
}
}
And here is the output :
IGNOU Solved Question Paper BCSL-043 (JAVA PROGRAMMING LAB)I hope you liked the working answer by my side and also visit my site again
for more question paper solutions
solutionsignou.blogspot.com .