Question: Question 1 In this lab assignment, you are asked to write java code of given classes in the following class diagram. Circle # radius: double
Question
In this lab assignment, you are asked to write java code of given classes in the following class diagram.
Circle
# radius: double
# color: String
PI:double
getRadius: double
setRadiusradius:double: void
getColor:String
setColorcolor:String: void
getArea:double
draw:void
Curve
angle: double
getAngle: double
setAngleangle:double: void
getArea:double
drawval:double:void
Cylinder
height: double
getHeight: double
setHeightheight:double: void
getArea:double
drawval:int:void
Instructions:
Create classes with defined attributes.
Write the methods of classes according to the given signatures,
quad Pl as a constant final attribute. PI
You can get class name using the following code in java:
this.getClassgetSimpleName;
The methods draw getArea give information when it is invoked. It prints out the class name and method is invoked
ie draw method has the following line:
System.out.printlnthisgetClassgetSimpleName draw method is invoked";
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
