Java Program To Display A Human Face - Graphics

2 comments - Post a comment

/*Program Displaying the human face suing basic figures, circles, arcs, lines, etc. Done using Applets.

/* < applet code = "Face" width = 500 height =500>
< /applet> */

import java.awt.*;
import java.applet.*;

public class Face extends Applet
{
public void paint(Graphics g)
{
g.drawString("Hi !!!!!!!!!!!!!!! I Am Ninad.",20,30);

g.drawArc(30,50,200,200,0,360); // Main Face
g.drawArc(82,80,30,30,20,160); //Left Eye Brow
g.fillArc(85,85,25,25,0,360); //Left Eye
g.drawArc(152,80,30,30,20,160); //Right Eye Brow
g.fillArc(155,85,25,25,0,360); //Right Eye
g.drawRect(90,190,80,20); //Mouth

g.drawLine(130,135,115,160); //Nose Left Line
g.drawLine(130,135,145,160); // Nose Right Line
g.drawLine(115,160,145,160); // Nose Base

g.drawString(" ------------- Created By Lionel.",10,350);
}
}

 

Pyramid Of Numbers 4 - Java

1 comments - Post a comment

class pyramid1
{
public static void main(String args[])
{
int i,j;
for(i=1;i<=3;i++)
{
for(j=1;j<=i;j++)
System.out.print(j+"\t");
System.out.println();
}
}
}

/* OUTPUT

1
1 2
1 2 3

 

Percentage of Students

No Comment - Post a comment

/* Java program to find percentage of student in 5 subjects

class Percentage
{
public static void main(String args[])
{
float Eng, Hindi, Marathi, Science, Social, percent;
Eng=Integer.parseInt(args[0]);
Hindi=Integer.parseInt(args[1]);
Marathi=Integer.parseInt(args[2]);
Science=Integer.parseInt(args[3]);
Social=Integer.parseInt(args[4]);
percent = (Eng+Hindi+Marathi+Science+Social)/5;
System.out.println("Subjects Offered : English, Hindi, Marathi, Science, Socail Studies");
System.out.println("Percentage"+percent);
}
}