pro48.java

import java.applet.*; import java.awt.*; /*<applet code = "pro48" width = 500 height = 600> <param name = "a1" Value = "10"> <param name = "a2" Value = "20"> <param name = "a3" Value = "30"> </applet> */ public class pro48 extends Applet { int x,y,z,sum=0,avg=0; public void init() { x=Integer.parseInt(getParameter("a1")); y=Integer.parseInt(getParameter("a2")); z=Integer.parseInt(getParameter("a3")); } public void paint(Graphics g) { sum=x+y+z; avg=sum/3; g.drawString("Total Sum is"+sum,100,100); g.drawString("Total avg is"+avg,150,150); } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.