Share
Explore BrainMass

Debugging Java Codes

****This needs to be written in Java*****

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 syntax, semantic, and logic errors. Perform the following steps to debug the classes.

1. Read through the code of TestCircle, Circle, and Shape and fix any errors that you see.

2. Save the files.

3. Compile the classes. If complier displays any compilation errors, fix the errors and recompile.

4. When you've fixed all syntax and semantic errors so that classes compile without errors, run the TestCircle program and look for runtime and logic errors. Fix all errors and recompile.

5. When the program runs clean it should produce the output shown in Figure 10-58 (attached to post).

Four files attached:

TestCircle.java
Circle.java
Shape.java
Figure 10-58.jpg

****This needs to be written in Java*****

Attachments

Solution Summary

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.

$2.19