Write an applet to display (draw) a picture of a person with arms, legs, body, and head.
Also draw eyes, eyebrows and a nose on the picture.
Use a happy face for the head and use ovals for them. Don’t hesitate to be creative. There are two kinds of methods for oval. The methods drawOval for an empty oval and fillOval for a filled oval (to fill it with a color) hat are available in JDK.
On the top part of the applet show a caption like “My rendition of a person” and in the next line show current date.
Note: Do not display a real picture(gif file) on applet. You need to write a program to draw a person on the applet.
Source Code:
import java.awt.*;
import java.applet.*;
public class face extends Applet
{
public void paint(Graphics g)
{
g.drawOval(40, 40, 120,
150);
g.drawOval(57, 75, 30,
20);
g.drawOval(110, 75, 30,
20);
g.fillOval(68, 81, 10,
10);
g.fillOval(121, 81, 10,
10);
g.drawOval(85, 100, 30,
30);
g.fillArc(60, 125, 80, 40,
180, 180);
g.drawOval(25, 92, 15,
30);
g.drawOval(160, 92, 15,
30);
}
}
Program Screenshot:
output screenshot:
Write an applet to display (draw) a picture of a person with arms, legs, body, and...
can this code be provided?
Project #3
Introduction
As you wrap up with JavaScript, let's put together everything
you've learned to make the classic game "Hangman" in a
webpage.
If you are unfamiliar with the rules of Hangman, the game
works like this:
A gallows is drawn on a surface, and Player 1 chooses a word
that player 2 must guess.
Empty dashes for each letter in the word are drawn next to the
gallows (so a 7-letter word means...