The Greenfoot Network:  Greenfoot.org    The Greenroom

Password (Forgotten it?)
    Fuel Depot Question
    last edited Jan 09 2016 by Richard Bradley

    Created by Rebecca Lenox. Other contributors: Richard Bradley

    Short description:

    This is a shell for the Fuel Depot Question from the AP CSA 2011 Free Response

    Full description:

    Students should complete the two methods in the Fuel Depot question and can check the logic using this shell. Uses an ArrayList of tanks and they need to access the instance variable that has the fuel level. They need to find the lowest tank and pass that index to the filler robot so he can move to that location.

    Level: (Intermediate)

    Duration: Students should be able to write out the methods and then go check them in a class period worth of time.

    Teaches: Practice using ArrayList methods, conditionals,using accessor methods outside a class for instance variable information, and using methods provided for class objects.

    -RB

    added additional moveToLocation implementations that show progression towards AP CS A learning objective: Truth Tables & Nested logical condition testing. (+ XOR)

    also corrected typos from post.

    Available when logged in (join via the front page, for free):
    • View 3 comments on this resource.
    • View resource history, links to related resources.
    • Leave feedback for the author(s), or help by editing the resource.

    Files:
    doc FuelDepotStudent.gfar
    Shell for student use (downloads: 42)

    doc FUELDEPOTsolution.gfar
    Solution (downloads: 38)

    doc FUELDEPOTv2.gfar
    AP CS A mapped to Learning Objective of using Truth Tables and nested logical condition tests (downloads: 14)

    Download All
    Total downloads for all files (including previous versions): 310

    Sets:

    Created by Supported by
    Copyright King's College London, 2017. Contact us.