Question: 1 . Create the class diagram for a class named Circle with fields named radius, area, and diameter. Include get methods for each field, but
Create the class diagram for a class named Circle with fields named radius, area, and diameter. Include get methods for each field, but include a set method only for the radius.
Also write the pseudocode for the class and include a constructor that sets the radius to
When the radius is set, do not allow it to be zero or a negative number. When the radius is set, calculate the diameter twice the radius and the area the radius squared times pi which is approximately
Code to go into the setRadius method:
if rad then
radius
else
radius rad
endif
diameter radius
area radius radius
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
