CODING:
/*<applet code="SA" width=300 height=100>
<param name="n1" value="50">
<param name="n2" value="40">
<param name="n3" value="30">
</applet>*/
import java.applet.*;
import java.awt.*;
public class SA extends Applet
{
public void paint(Graphics n)
{
int a=Integer.parseInt(getParameter("n1"));
int b=Integer.parseInt(getParameter("n2"));
int c=Integer.parseInt(getParameter("n3"));
n.drawString("Value : "+a+" "+b+" "+c,70,30);
n.drawString("SUM : "+(a+b+c)+ " AVERAGE: "+((a+b+c)/3),50,50);
}
}
<param name="n1" value="50">
<param name="n2" value="40">
<param name="n3" value="30">
</applet>*/
import java.applet.*;
import java.awt.*;
public class SA extends Applet
{
public void paint(Graphics n)
{
int a=Integer.parseInt(getParameter("n1"));
int b=Integer.parseInt(getParameter("n2"));
int c=Integer.parseInt(getParameter("n3"));
n.drawString("Value : "+a+" "+b+" "+c,70,30);
n.drawString("SUM : "+(a+b+c)+ " AVERAGE: "+((a+b+c)/3),50,50);
}
}
Comments
Post a Comment