The emphasis in this assignment is to break down a complex task into smaller ones (hierarchical decomposition), and implement the reduced components with methods.
This assignment is the first part of a two-parter. Assignment 3 will build off this one, so make sure to do your due diligence!
Let's first look at the final goal:
To achieve this, your Stargazing program requires a drawScene method.
That drawScene must relocate the turtle to random locations, to draw four oopsies. An oopsie is comprised of three pieces:
A littleDude
The path of a small comet hitting the little dude
An explosion of debris flying from the point of impact
The little dude is a pentagon (side length of 10) for a head, and a five-pointed asterisk (fin length of 20) for a body.
The path of comets is a diagonal line of six pentagons, each 10 pixels/units apart. The explosion is a sweep of five pentagons, each 25 pixels from the point of impact.
Note that this requires a good several methods!
Tips and requirements
Speed up your turtle. Seriously.
Don't use parameters/arguments for your methods
â—¦ There's an 'Assignment 3' for a reason...
The entire point of this assignment is hierarchical decomposition (breaking down the
problem into smaller pieces), so if you skip that step, don't be surprised if you get a zero
Your final solution probably won’t be exceptionally long. It isn't a challenging assignment, per se, but rather one that reinforces what you learned in lecture/lab/tutorial. It covers a fundamental technique in computer science. Give it the consideration and attention your entire academic future deserves
Because you're using procedural abstraction, you might want to consider writing stubs to get the basic components together
â—¦ e.g. I wrote methods for each piece, even before they ‘did’ anything • Don't forget that Help Desk is a thing!
Submission:
For submission, you must submit a .zip file containing the following:
• A folder called Assign_2, containing your submission
Your Stargazing.java source file
Your BlueJ folder/project files
A .pdf copy of your stargazing pattern
â–ª When the program finishes, before clicking Close, just click File → Print Image of Window... → and then select to print to a file
â–ª If you're having any trouble doing this on Windows, CutePDF might make it easier
â–ª If you find yourself struggling with the output shortly before you need to submit, for only this assignment, you can just use File → Save Window as Image... and save it as a picture instead
On Sakai, submit your .zip file as an attachment, and click to Submit.
Note: Do not submit a .rar, .tar.gz, .7z, etc. Every major operating system supports
.zip, so it is mandatory if you wish to receive a grade for your assignment. Standards:
Ostensibly, you'll be graded for following basic coding standards and documentation requirements. At the very minimum:
A comment at the top of all source (.java) files including your name and student number
Variable names that are either standard or descriptive
â—¦ Using things like i and j for loop counters? Standard
â—¦ Using a variable like count? We can guess what you meant
For any blocks of code (e.g. loops) insert a brief comment so the reader knows what's
inside (e.g. what's being repeated)
Put a comment in front of any method, to briefly explain what it does
Anything you think the marker might not understand? Add a quick comment
â—¦ This probably isn't a concern for this assignment
Additionally, try to remember to fix the indentation of your source files. Jagged margins can be harder to follow along with.
2nd Dec 2022
Statement on the Interim Report of the Presidential Working Party on Education Reform. The Presidential Working Party on Education Reform presented a
29th Nov 2022
Task 1: Find the odd triangular numbers that are smaller than a number specified by the user and print them. For example, if the user chooses to print all
21st Nov 2022
Weight Loss after Pregnancy and Child Birth Reclaiming your body after childbirth can be challenging because this is a time when you are trying to learn a
weight loss, post-partum weight, pregnancy, weight loss journey, baby weight, losing weight after childbirth, breastfeeding, healthy diet after pregnancy, home remedies for weight loss
Comments (0)
Leave a Comment