Q7: Extending Bubbles

Table of Contents


  • Learn about colors and transparency.
  • Practice using loops to position objects.
  • Make use of arrays to position objects.
  • Use pair programming techniques to solve problems.

Academic Honesty

Read the Scholastic Honesty Policy and Assignment Integrity policies of the syllabus. Here are some clarifications for this particular assignment:

  • The first project is a guild project that you must complete with the rest of your guild members. The solo work must be original and the guild work should all be the same.
  • The second project is a pair-programming project that you are expected to work on with one other student of this class following the rules of Pair Programming for Homework Assignments.
  • You and your pair-programming partner are expected to turn in the same code for the second project, though you both turn in the project.
  • You may copy small portions of the code from the textbook or the instructor's web pages.
  • You may get help from people other than your pair-programming partner if you get stuck, but only if they do not show or tell you the code to type. Instead they should show you other examples that you can adapt to your code.
  • For the second project, do NOT copy or modify code from, nor provide code to, any other student or unauthorized source.
  • For the second project, do NOT give a copy of your code to your designated pair-programming partner if you did not develop the code together.

Quest Specifications

Complete the following quest specifications to meet the objectives.

Blackboard with words who, what, when, why and where
Image source

Project 1: First Guild Project Retrospective

After a project completes, successful guilds talk about how to improve for the next project. This review is often called a Project Retrospective. The Project Retrospective has two parts:

  1. Solo Requirements: preparation for a guild meeting
  2. Guild Requirements: guild meeting to discuss how to improve for future projecys

A. Solo Requirements

  1. Before meeting with your guild, save this Project Retrospective following the menu File > Download as > Plain Text (.txt), and save the file as firstproject.txt.
  2. Thoroughly fill out and answer the questions in firstproject.txt without deleting any of the existing text.
  3. Bring your analysis from the firstproject.txt to discuss at the guild meeting.

B. Guild Requirements

  1. Meet as a guild, all at the same time, and discuss the first guild project: Q6: Scenario Mashup.
  2. As a guild, discuss the items in everyone's solo firstproject.txt file and any other topics the guild wants to talk about.
  3. As a guild, summarize the discussion under the five topics outlined in firstproject.txt, plus any added topics, and distribute the summary to all guild members.
  4. Name the file of summarized topics guild.txt and include the guild name and members in the document.
  5. Each guild member turns in two files as described in Deliverables:
    1. individual copy of file firstproject.txt (different for everyone)
    2. summary file guild.txt (same for everyone)

Note that firstproject.txt is your solo work and guild.txt is a summary of the guild discussion. The firstproject.txt content should be unique and the guild.txt content should be the same for all guild members.

Image source

Project 2: Extending Bubbles

This project is based on a scenario from the end of chapter 6 in the textbook. If you have not completed the pair programming worksheet from Lab 3, you may do so before this quest for half credit.

  1. Work with one other student following the rules of Pair Programming for Homework Assignments.

    If you cannot find a partner, talk to the instructor right away. If there are an odd number of students, the instructor may assign one group of three students.

  2. Start with the completed bubbles scenario we worked on in class, or the scenario from the end of chapter 6 in the textbook if you do not have the in-class scenario.
  3. In the world subclass, create a new private method named setup(). Call this method from the constructor. In this method, create a new bubble, using the default constructor of Bubble, and place it in the middle of the world.

    The prepare() method is not needed or allowed, so remove it if you have one.

  4. Add a while-loop to the setup() method that places 11 bubbles randomly in the world. Add a comment to your code above this loop that states what the code is attempting to do.
  5. Add a for-loop to the setup() method that creates 21 bubbles along a diagonal with an x and y distance of 30. The first bubble at (0,0), the next at (30, 30), then (60, 60), and so on. The last bubble will be at (600, 600) for 21 bubbles. Add a comment to your code above this loop that states what the code is attempting to do.
  6. Add a second for-loop to the setup() method that places 12 bubbles on a horizontal starting at x=200, y=100, with x increasing by 40 each iteration and y remaining constant at 100. Thus the first bubble is at (200, 100), the next at (240, 100), then (280, 100), and so on. The size of the bubble must increase as well, stating with a size of 10 for the first bubble and increasing in size by 10 each iteration of the loop. Use the Bubble constructor with one parameter to set the size. Add a comment to your code above this loop that states what the code is attempting to do.
  7. Add a third for-loop to the setup() method that creates 19 concentric bubbles at the center of the world. The bubbles start with a size of 190, decreasing by 10. The last bubble has a size of 10. Make sure to create the largest bubble first and the smallest last, so you have bubbles of sizes 190, 180, 170, and so on , all lying on top of each other. Add a comment to your code above this loop that states what the code is attempting to do.

    Use the constructor of Bubble with two parameters to set the initial direction (see exercise 7.4 step 5). Set the direction of the first bubble at 0, the second at 20, the next at 40, and so on. Notice that the direction of each subsequent bubble is increasing by 20 degrees. When the scenario runs, these overlapped bubbles expand outwards in all directions from the center of the world.

  8. Add two integer arrays, one named xDiag and the other named yDiag, to store the (x, y) coordinates for positioning bubbles from the upper right-hand corner of the screen to the lower left-hand corner of the screen. Create and position 24 bubbles and make sure each array has 24 elements. Use a for-loop to read the coordinates for the position of each bubble from the xDiag and yDiag arrays.
  9. Update the Scenario Information (README.TXT file) for your project to fill in all the Greenfoot supplied information like your name, project title and version or date, as well as providing the current status. Include the name of your pair-programming partner. Even though the project file may not include the usual labels, like those shown below, please add them.
  10. PROJECT TITLE: Bubbles
    PURPOSE OF PROJECT: Draw bubbles at specified positions.
    HOW TO START THIS PROJECT: Press run after compiling,
    AUTHORS: Your Name (and Pair Programming Partner)
    USER INSTRUCTIONS: Watch the pretty bubbles!
  11. Submit a zip file (with all source code) of your bubbles project to Canvas as explained in the section of this document: How to Submit.

Project Extra Credit

Adding the following are worth extra credit points:

  1. Add a 3 parameter constructor to the Bubble class with the following signature: (1 point)
     * Create a Bubble with the given size, initial direction and speed.
     * @param size Overall diameter of this bubble.
     * @param direction Initial direction in which this bubble moves.
     * @param speed Rate this bubble moves in pixels per act cycle.
    public Bubble(int size, int direction, int speed)

    The constructor must implement the specified parameters.

  2. After completing extra credit 1, add two more arrays to store the (x, y) coordinates, one named xName and the other named yName, for positioning bubbles arranged in the shape of your initials in the upper right quadrant of the world. Two letters of your initials is enough and the size of each letter must be at least 4 x 5 bubbles. Use a for-loop to read the coordinates for the position of each bubble and call the three-parameter constructor with a speed of 0. Pair programming on this extra credit is optional but requires both sets of initials. (2 points)

Make certain that your README.TXT file describes any extra credit attempted.

Grading Criteria

The instructor will evaluate your assignment using the following criteria. Each criteria represents a specific achievement of your assignment and has a scoring guide. The scoring guide explains the possible scores you can receive.

Some scoring guides have a list of indicators. These indicators are a sign of meeting, or a symptom of not meeting, the specific criterion. Note that a single indicator may not always be reliable or appropriate in a given context. However, as a group, they show the condition of meeting the criterion.

For information on grading policies, including interpretation of scores, see the syllabus page.

Solo Retrospective Criteria

  • 2: Completed the firstproject.txt file with substantial effort
  • 1: File firstproject.txt submitted but incomplete or minimal effort.
  • 0: No firstproject.txt submitted

Guild Retrospective Criteria

  • 2: Guild completed the guild.txt report with substantial effort
  • 1: File guild.txt submitted but incomplete or minimal effort.
  • 0: No guild.txt submitted

Project Functionality

  • 10: Demonstrates mastery of the assignment
    • Has extra features or demonstrates techniques beyond the assignment
    • Applies concepts from the lesson(s) appropriately
    • Meets all specifications with particularly elegant solutions
    • No errors encountered during operation
  • 8: Has all the functionality expected of the assignment
    • Demonstrates many techniques from the lesson
    • Meets all specifications
    • Implementation seems more complicated than necessary.
    • May have one minor error
  • 6: Has most of the functionality expected of the assignment
    • Demonstrates some techniques from the lesson
    • Meets all but one of the specifications
    • Implementation seems excessively complicated.
    • May have 2-3 minor errors
  • 4: Has some of the functionality expected of the assignment
    • Demonstrates some techniques from the lesson
    • Meets at least 1/2 of the specifications
    • Implementation seems excessively complicated.
    • May have more than 3 minor errors
  • 2: Serious functional problems but shows some effort and understanding
    • Meets less than 1/2 of the of the specifications
    • Has a major error or many minor errors
    • Implementation seems very convoluted
    • Demonstrates few techniques from the lesson
  • 0: Does not execute, no specifications met, or wrong folder name
  • -2: penalty for not pair programming

README.TXT File for Project 2

  • 2: README.TXT file submitted with specified information included
  • 1: README.TXT submitted but some information was not included
  • 0: No README.TXT submitted or wrong folder name

Maximum Score: 16, plus extra credit


Follow these instructions carefully and exactly to turn in your quest (assignment) to Canvas and maximize your XP:

  1. Locate your completed bubbles scenario folder.
  2. Add the firstproject.txt worksheet to the folder.
  3. Add the guild.txt worksheet to the folder.
  4. Zip the folder and submit the zip file to the Q7: Extending Bubbles slot of Canvas.

    Note: both partners turn in the scenario, and the turned-in scenario must be the same for both partners.

Please do not add any extra characters to the above folder names. Also, do not put any spaces or special characters like #, : or $ in zip file or folder names. Your crafted code must work as submitted. Remember to test and double check your files before and after submitting them. If you make a mistake, you can resubmit up to the deadline but must resubmit all your quest files.

Last Updated: March 24 2020 @19:14:03