Question: using onlinegdb.com Task 2. Programming tasks: (50 pts) 1) Create class Circle according to below UML class diagram. Constructor without parameters should initialize circle radius

 using onlinegdb.com Task 2. Programming tasks: (50 pts) 1) Create class
using onlinegdb.com

Task 2. Programming tasks: (50 pts) 1) Create class Circle according to below UML class diagram. Constructor without parameters should initialize circle radius to 2 and color to yellow. (15 pts) calcArea method should return area of the circle (S = 3.14*r*r) (5 pts) sal Circumference should retum circumference of the circle (C = 2*3.14*r) (5 pts) Circle +radius:double +color:String +Circle) +Circle(int radius) +calcAreal):double +calcCircumference():double Your program code: 2) In the Main program, create objects of Circle according to below UML Object diagram. For each object: initialize fields, print fields, and call its methods. (10 pts) 3) Write if-else statement to print only yellow circles. (check both circles) (10 pts) 4) Write if-else statement: if circle is blue, then its radius should increase for 3 unit. Print blue circle's radiuses after change. (5 pts) C1:Circle C2:Circle +radius=3 +color="yelow" +radius=5.2 +color="blue" Your program code: Screenshot of your program with output

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!