Lab 4

(week of Feb 9 - 13)


The purpose of this lab is to practice more on classes, objects, and methods.

There are two parts in Lab 4.

Part 1: Debug  a Java Program.


Question 1:

A Java program comprises four Java source code files.

This program is not working.

You job is to debug the program and make it work.

1. Comment the source code.

2. Explain to the lab instructor/GA next week if you want.

Remember to comment your change so that you can answer exactly what are the corrections you made.


Part 2: Programming Question.

Question 2:

Fill in the missing parts in the Java source code.


Remember to sign the lab attendance sheet before you leave.


Supplemental Assignment

1. Write a program that displays all the prime numbers before 10000.

2. Write a program that takes an interger from the user as input and output its reverse as output.

For example, the user inputs 1234 and your program should output 4321.