Programming Projects, Chapter 1
Question 1
Question 2
- Create
(by hand) a copy of FirstProgram.java
- Compile it until there are no errors
- Run it
Question 3
- Modify FirstProgram.java so that it adds three
numbers instead of two
- Compile it
- Run it
Question 4
- Cut and paste the following code into notepad:
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 TRANSITIONAL//EN">
<html>
<head>
<title>Test
Java Applet</title>
</head>
<body>
<applet
code=HappyFace.class
width=1000
height=1000
</applet>
</body>
</html>
- Save as “test.html” in the same folder as
Happyface.class
- Open test.html with a web brwoser (e.g. internet
explorer). The happy face should appear.
- Change HappyFace so that it displays a picture of a snowman.
[Hint: draw three circles one above the other. Make the circles
progressively smaller going from bottom to top. Make the top circle a happy
face.]
[24-Oct-06]