Can you help me fill in blanks below please? Declare and initialize an array of
ID: 3904703 • Letter: C
Question
Can you help me fill in blanks below please?
Declare and initialize an array of three Zoogs.
______ zoogs;
zoogs= new ___________;
Initialize the element at index zero of zoogs to a new Zoog object. (for reference: the object is passing arguments (100,100,50,60,16)to its constructor).
zoogs____________ = ____________(100, 100, 50, 60, 16);
Create a new Zoog object at index 1 of the array zoogs. The Zoog object will have the values (10,20,30,40,50) for instance variables.
____________ = ______ (___________________);
Create a new Zoog object at index 2 of the array zoogs. The Zoog object will have the values (50,40,30,20,10) for instance variables.
____________ = ______ (___________________);
Explanation / Answer
Declare and initialize an array of three Zoogs.
Zoog[] zoogs;
zoogs= new Zoogs[3];
Initialize the element at index zero of zoogs to a new Zoog object. (for reference: the object is passing arguments (100,100,50,60,16)to its constructor).
zoogs[0]=new Zoog(100, 100, 50, 60, 16);
Create a new Zoog object at index 1 of the array zoogs. The Zoog object will have the values (10,20,30,40,50) for instance variables.
zoogs[1]=new Zoog(10,20,30,40,50);
Create a new Zoog object at index 2 of the array zoogs. The Zoog object will have the values (50,40,30,20,10) for instance variables.
zoogs[2]=new Zoog(50,40,30,20,10);
Do give a thumbs up and in case there are doubts leave a comment.