pleasa help me?

pleasa help me?

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 is data fields.

A public method named changeColour(String) to change the value of the Circle object is 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 is 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:
pleasa help me?
ModuleNotFoundError: No module named 'me2'
Advertisements
ModuleNotFoundError: No module named 'mep'
ModuleNotFoundError: No module named 'mex'
ModuleNotFoundError: No module named 'Meh'
ModuleNotFoundError: No module named 'mes'
ModuleNotFoundError: No module named 'mez_xml'
ModuleNotFoundError: No module named 'nester_meu'
ModuleNotFoundError: No module named 'mew'
ModuleNotFoundError: No module named 'mew'
ModuleNotFoundError: No module named 'nester_mei'
ModuleNotFoundError: No module named 'meh_schachtler'
mew 333
ModuleNotFoundError: No module named 'med'
ModuleNotFoundError: No module named 'meg'
ModuleNotFoundError: No module named 'met'
ModuleNotFoundError: No module named 'mec-translator'
ModuleNotFoundError: No module named 'metering-mec'
ModuleNotFoundError: No module named 'mem'
ModuleNotFoundError: No module named 'mem'
ModuleNotFoundError: No module named 'med-z'
ModuleNotFoundError: No module named 'scikit-med'
ModuleNotFoundError: No module named 'scikit-med'
ModuleNotFoundError: No module named 'django-mes-fichiers'
ModuleNotFoundError: No module named 'meg-runtime'
ModuleNotFoundError: No module named 'meg_server'
ModuleNotFoundError: No module named 'meg-withings'
ModuleNotFoundError: No module named 'mec-plugin-cloudify'
ModuleNotFoundError: No module named 'mec-plugin-cloudify'
ModuleNotFoundError: No module named 'cloudify-mec-plugin'
ModuleNotFoundError: No module named 'met-estimator'
ModuleNotFoundError: No module named 'mET-weap'
ModuleNotFoundError: No module named 'mem-edit'
ModuleNotFoundError: No module named 'mem_top'
ModuleNotFoundError: No module named 'mem-package'
ModuleNotFoundError: No module named 'mem_top'
ModuleNotFoundError: No module named 'ps_mem'
Cool Tattoo Ideas for Men
ModuleNotFoundError: No module named 'python-daily-med'
ModuleNotFoundError: No module named 'python-daily-med'
ModuleNotFoundError: No module named 'meg-django-remote-forms'
ModuleNotFoundError: No module named 'meg-django-tastypie'
ModuleNotFoundError: No module named 'meg-django-twitter-bootstrap'
ModuleNotFoundError: No module named 'meg-django-remote-forms'
ModuleNotFoundError: No module named 'meg-django-tastypie'
ModuleNotFoundError: No module named 'meg-django-twitter-bootstrap'
ModuleNotFoundError: No module named 'Project3-my-func-meg-test'
ModuleNotFoundError: No module named 'mem-usage-ui'
ModuleNotFoundError: No module named 'microhomie-node-mem'
ModuleNotFoundError: No module named 'powerline-mem-segment'

Ads