Question: using greenfoot A. Open the bubble scenario. You will see that the world is empty. In the world subclass Space, create a new private method
using greenfoot
A. Open the bubble scenario. You will see that the world is empty. In the world subclass Space, create a new private method called setup(). Call this method from the constructor. In this method, create a new bubble and place it in the center of the world. B. Using a while construct, modify the setup() method to additionally place bubbles on a diagonal line. The first bubble shall be placed at 0,0, and each additional bubble shall be added so that they go from the top left corner of the world to the bottom right corner of the world. The last bubble shall be at 900,600 (for 21 bubbles in total). Use your loop counter variable to achieve computation of bubble placement. Please note there are two bubbles in the center of the display. C. Add another while loop to the setup() method that places some more bubbles. This loop shall place 10 bubbles, in a horizontal line, starting at x=300, y=100, with x increasing by 40 every time and y being constant. (That is, the bubbles are at 300, 100, then 340, 100, then 380, 100, and so on.) The size of the bubble shall also increase, starting with 10 for the first bubble, then 20, then 30, etc. Use the second Bubble constructor for this (the one with one parameter). Use your loop counter variable to achieve computation of bubble size and placement.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
