Cosc 1p02 Assignment 2


    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!

    page1image3123152

    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

    page2image3768512page2image3769280

    â—¦ 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.


    Tags:



    Related Posts


    Comments (0)

    Leave a Comment

    Type the above code here


    More from hatequizzes




    Categories


    HealthHealth & FitnessEducationHome & GardeninsuranceFinanceQuestions & answersGeneralParentingLaw & AttorneyLoan & InsuranceHosting & DomainLatest JobsAutomotiveHow to