JAVA

PART -A

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6 PROGRAM 7

PART-B

PROGRAM B1 PROGRAM B2 PROGRAM B3 PROGRAM B4 PROGRAM B5 PROGRAM B6 PROGRAM B7 PROGRAM B8 . . .

 
  
 /*
 8. Write an applet to draw n squares, rectangle and circles
 
 */
import java.applet.*; 
import java.awt.*; 



public class programb8 extends Applet 
{
int x=300,y=100,r=50; 
public void paint(Graphics g) 
{
        g.drawOval(x-r,y-r,100,100);
         g.drawString("Circle",275,100); 
        g.drawRect(400,50,200,100);
         g.drawString("Rectangel",450,100); 
        g.drawString("(e).Polygon",90,250);


    int a[]={200,400,200,400};
    int b[]={200,500,500,200};
    g.drawPolygon(a,b,4);
}

}



 



    <html>  
    <body>  
    <applet code="programb8.class" width="300" height="300">  
    <param name="msg" value="Welcome to applet">  
    </applet>  
    </body>  
    </html>