[SOLVED] SOLVED:LAB circle and Circle Driver

23.99 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (2 votes)

Create a java class Circle as described below: radius: a double PI: a final double initialized with the value 3.14159 The class should have the following methods: calculateArea – Returns the area of the circle, which is calculated as: area = PI * radius * radius calculateDiameter – Returns the diameter of the circle, which is calculated as: diameter = radius * 2 calculateCircumference – Returns the circumference of the circle, which is calculated as: circumference = 2 * PI * radius setRadius – A mutator (setter) method for the radius field getRadius – An accessor (getter) method for the radius field Create test data and calculate the expected result. Input Expected Results Radius Area Diameter Circumference – – – – – – – – – – – – Write a program name CircleDriver that demonstrates the Circle class by asking the user for the circle’s radius, creating a Circle object, and then reporting the circle’s area, diameter, and circumference.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.