Question: Write a program that initializes and create an array of doubles that represent the radius of circles e.g., double [] rad= {11.6, 12.8, 14.9, 10.1,
Write a program that initializes and create an array of doubles that represent the radius of circles
e.g., double [] rad= {11.6, 12.8, 14.9, 10.1, 12.2}. For each circle, print out the circle number, the radius, area of the circle (area = pr2) and the circumference of the circle (C = 2 pr). Make sure your output is nicely formatted and you control the decimal to 2 places. Test this with two outputs where you have changed the array elements and lengths.
See below for the sample output:
Sample output for rad = {11.6, 12.8, 14.9, 10.1, 12.2}

GRASP exec: java Lab7 Circles Circle Num Circle1 Circle2 Circle3 Circle 4 Circle5 Radius 11.60 12.80 14.90 10.10 12.20 Area 422.73 514.72 697.46 320.47 467.59 Circumference 72.88 80.42 93.62 63.46 76.65 jGRASP operation complete
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
