Purchase Solution

Debugging Java Codes

Not what you're looking for?

Ask Custom Question

****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*****

Purchase this Solution

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.

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Javscript Basics

Quiz on basics of javascript programming language.

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.