Java Reference
In-Depth Information
Debugging Assignment
The UserList program is a Java application that accepts a user name and adds it
to a list, if it does not already exist. It accepts a maximum number of user names
and when full, responds with a message displaying the last name entered. The
program will not accept the user name, username, as a valid entry.
The UserList program has several syntax, semantic, and logic errors in the
program code. Perform the following steps to debug the program.
1. Start TextPad and open the file, UserList.java, from the Chapter09 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.
2. Read through the code and fix any errors that you see. Insert today's date
and your name as the programmer in the comment header.
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 9-47, print a copy of the source code.
FIGURE 9-47
Search WWH ::




Custom Search