Java Reference
In-Depth Information
Debugging Assignment
Start TextPad and open the file Runyon.java from the Chapter02 folder on the
Data Disk. See the preface of this topic for instructions for downloading the
Data Disk or see your instructor for information about accessing the files
required in this topic.
The Runyon program is a Java application that displays a splash screen for
the Runyon Company, listing its name, address, and Web site address. The
desired output is shown in Figure 2-73.
FIGURE 2-73
The Runyon program has several syntax, semantic, and logic errors in the
program code. Perform the following steps to debug the program.
1. Open the file Runyon.java in TextPad.
2. Read through the code and fix any errors that you see. Insert your name as
the programmer in the comment header. Insert the current date.
3. Save the program.
4. Compile the program. As TextPad displays compilation errors, fix the first
error, then recompile.
5. When you have fixed all the syntax and semantic errors so that the program
will compile without errors, run the 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 2-73, print a copy of the source code.
Search WWH ::




Custom Search