Java Reference
In-Depth Information
Learn It Online (continued)
3. Crossword Puzzle Challenge Click the Crossword Puzzle Challenge link
below Chapter 10. Read the instructions, and then enter your first and last
name. Click the Play button. Complete the crossword puzzle. When you are
finished, click the Submit button. When the crossword puzzle is displayed,
click the Print button.
4. Tips and Tricks Click the Tips and Tricks link below Chapter 10. Click a
topic that pertains to Chapter 10. Right-click the information and then click
Print on the shortcut menu. Construct a brief example of what the informa-
tion relates to in Java to confirm you understand how to use the tip or trick.
Hand in the example and printed information.
5. Newsgroups Click the Newsgroups link below Chapter 10. Click a topic
that pertains to Chapter 10. Print three comments.
6. Expanding Your Horizons Click the Expanding Your Horizons link below
Chapter 10. Click a topic that pertains to Chapter 10. Print the information.
Construct a brief example of what the information relates to in Java to con-
firm you understand the contents of the article. Hand in the example and
printed information.
7. Search Sleuth Select three key terms from the Key Terms section of this
chapter and then use the Google search engine at google.com (or any major
search engine) to display and print two Web pages for each key term.
Debugging Assignment
The TestCircle class is a Java application that creates a Circle object using the
class, Circle, which incorporates the class, Shape. The TestCircle class displays the
name of the shape; the radius as an X, Y coordinate location; and the area. It also
changes the radius to a new value and then displays the same information in a
different format. The class should not be able to create an object of type Shape.
The source code for the TestCircle, Circle, and Shape classes have several syn-
tax, semantic, and logic errors. Perform the following steps to debug the classes.
1. Start TextPad and open the files, TestCircle.java, Circle.java, and Shape.java,
from the Chapter10 folder on the Data Disk.
2. Read through the code and fix any errors that you see. Create comment
headers and insert your name as the programmer along with today's date in
each program.
3. Save the files.
4. Compile the classes. If TextPad displays any compilation errors, fix the errors
and then recompile.
5. When you have fixed all the syntax and semantic errors so that the classes
will compile without errors, run the TestCircle program and look for run-
time and logic errors. Fix any errors and compile again.
6. When the program compiles and runs to produce the output as shown in
Figure 10-58, print a copy of the source code of each of the classes.
Search WWH ::




Custom Search