Question: In a new class called ArrayofCircles We are going to practice populating an array of objects Declare Circle Cir[] as an array and assign it

In a new class called ArrayofCircles

We are going to practice populating an array of objects

Declare Circle Cir[] as an array and assign it to 500 new circles.

  1. Practice initializing each circle individually using the following code:

cir[117]=new Circle (57.2);

      3.   Make the above code a comment.

      4.  Practice populating all 500 circles in a loop.

For  (int j=0; j<500;j++)

            {

                cir[j]=new Circle(10);

             }

     5.  Add your documentation


 

Which of these methods will be easiest for 500 circles? Why? Type your answer in a comment at the bottom of your program.

Step by Step Solution

3.45 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres an example of the requested code with comments and documentation ArrayofCircles class to practice populating an array of Circle objects public c... View full answer

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 Programming Questions!