Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please don\'t answer this question if you don\'t have it in pseudocode. I\'m not

ID: 3642009 • Letter: P

Question

Please don't answer this question if you don't have it in pseudocode. I'm not looking for it in java, C++, or anything like that. I just need clear, simple, pseudocode. Nothing else.

PSEUDOCODE for the following:

Write a Circle Class that has the following fields:

radius: a double
PI: a final double initialized with the value 3.14159

The Class should have the following:

Constructor - Accepts the radius of the circle as an argument.
Constructor - A no-arg constructor that sets the radius field to 0.0
setRadius - A mutator method for the radius field.
getRadius - An accessor method for the radius field.
getArea - Returns the area of the circle, which is calculated as
area = PI * radius * radius

getDiameter - Returns the diameter of the circle, which is calculated as
diameter = radius * 2

getCircumference - Returns the circumference of the circle, which is calculated as
circumference = 2 * PI * radius

Write a program that demonstrates the Circle class by asking the use for the circle's radius, creating a Circle object, and then reporting the circle's area, diameter, and circumference.

Explanation / Answer

Create a class named Circle with data members radius of type double and PI of type final double initialized to 3.14159 Contains a constructor that takes the radius of a circle as an argument and initializes the radius data member to that value Contains a no argument constructor that sets the radius data member to 0.0 Contains a method named setRadius that takes the radius of a circle as an argument and sets the circle's data member radius to that value Contains a method named getRadius that has no arguments and simply returns the radius as a double Contains a method named getArea that has no arguments and returns the area of the circle as a double by multiply PI by the radius squared Contains a method named getDiameter that has no arguments and returns the diameter of the circle as double by multiplying the radius by 2 Contains a method named getCircumference that has no arguments and returns the circumference of the circle as a double by multiplying PI by twice the radius In a driver class inside the main function, ask the user for the circle's radius, create a Circle with that radius, and then print the circle's area, diameter, and circumference.