help please?

help please?

Define a class named Circle with the following properties:

  1. List item

â?¢ An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both data fields specify the radius and the colour of the Circle object respectively. Set the default values of radius to 1 and the colour as â??redâ??.

â?¢ A private static constant named PI with a fixed value of 3.142 that represents the value of pi.

â?¢ A default constructor.

â?¢ A constructor that creates Circle objects with the given radius value as the argument.

â?¢ A public method to display the Circle objectâ??s data fields.

â?¢ A public method named changeColour(String) to change the value of the Circle objectâ??s colour based on the value in the method argument.

â?¢ A public method named getSurfaceArea() that calculates and returns the surface area of the Circle object. Use the constant PI value for the calculation.

â?¢ A public method named getCircumference() that calculates and returns the Circle objectâ??s circumference. Use the constant PI value for the calculation.

Write another class named TestCircle to test the Circle program by creating two Circle objects. The first object must be created using the default constructor, while the second object must be created with the radius value of 8. Display the properties of both objects and also their surface area and circumference.

View Answers









Related Tutorials/Questions & Answers:
help
help
Advertisements
help
HELP
Help...
Help
Help!
help
Help
help
help!!!!!!!!!!!!!!!!!!
Regular Expression Help Help HELP!!!!
Help me
help me
help me
Help Me
help
help
help
help
Help
Help
help
help
help
help
Help
Help
Timeseries help
help me
help me
help me
help me
help me..
Help me
Help in Struts2
help pleas? -_-
help me
help us
java help!
Help with this program
Help With Java...
Plz Help
help me...
help me..
help me
Help with this program
help me...
help in java
help in java

Ads