how do i solve this problem?

how do i solve this problem?

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:
how do i solve this problem?
how do i solve this question?
Advertisements
i dont no how to solve it pls
How do I upgrade mysql?
how should i can solve
How can I do it? .click();
ModuleNotFoundError: No module named 'solve-some-problems'
ModuleNotFoundError: No module named 'solve-some-problems'
How do i do the coding for 'leaving a comment' in java
How do I decompile Java class files?
How do I initialize a byte array in Java?
How do I compare strings in Java?
How do I learn data analysis with Python?
How do I compile the registration form?
How do I get started with Bootstrap
How do I get started with Bootstrap
How do I learn Spring Framework?
How do I learn Spring Framework?
How do I learn Spring Framework?
How do I learn Spring Framework?
How do I learn Spring Framework?
How do I study big data?
How do I start machine learning with Python? What should I do if I am a beginner?
How do I generate random number?
How do I do this program? I'm new to Java programming...
how do i grab the url in php?
ModuleNotFoundError: No module named 'problemo'
How do I start learning MongoDB?
How do I download urllib3 for python 2.7
How do I learn Python data science?
How do I start a data mining company?
How do I start learning AI?
How can I do data science course?
How do I prepare for a data scientist interview?
How do I start a data science career?
How do I become a data scientist in 2020?
How do I start learning machine learning?
How do I become a python master?
How do I learn machine learning?
How do I get a job in AI field?
How do I become an AI engineer?
How do I become a data scientist in India?
How do I become a data scientist for free?
How do I get a job in AI?
How do I start a deep learning career?
How do I become a machine learning engineer?
How do I start learning data science?
How do I switch to data science career?
How do I start data mining?
How do I start preparing for data science?

Ads