Lab 1: First Tutorial

Table of Contents


  • The purpose of this lab is to get you started with your first tutorial for the course.
  • In addition, the lab will introduce you to the following concepts:
    • source code
    • method call
    • parameter
    • sequence
    • if-statement
  • As part of the lab, you will see how to get started producing your own game.

Note: if you do not complete this lab on time, you might be dropped from the course. However, do not rely on the instructor to drop you because he may not. You are entirely accountable for failing to drop any course.

Academic Honesty

Read the Scholastic Honesty Policy and Quest and Lab Integrity policies of the syllabus. Here are some clarifications for this particular lab:

  • This is a solo lab that you must complete individually.
  • You may get help from others installing the Java compiler and Greenfoot, as long as you actually complete all the steps yourself.
  • You may discuss the code with other students for this lab.
  • You must type all the code yourself and not copy from another student.

Lab Specifications

Complete these labs before class on Tuesday 2/4/2020. But first make sure you have completed the exercises from lesson 1 as they are submitted as part of this lab.

Project A: Greenfoot Installation

For this lab you install the coding environment for the course.

  1. Install Greenfoot and Java on a computer system.
  2. Create a text file named install.txt and briefly describe:
    1. where you got the programs to install
    2. the version number of Greenfoot you installed
    3. the operating system of the computer you installed the programs on
    4. the installation steps you went through
  3. Test the installation by running the leaves-and-wombats scenario.

    In the install.txt file, describe the results of your test. Let Greenfoot update any scenarios if it asks.

Note that if you get stuck installing Greenfoot and Java, bring your problems or questions to class, visit the STEM Center or visit the instructor during office hours.

Project B: Code Practice

For this lab you prepare for and then practice coding skillz.

  1. Make sure you have completed the exercises from lesson 1.
  2. Register for CodeLab (Free) and complete the Chapter 1 exercises.

    These are review exercises and you have all the information needed to complete them. If you have questions, please contact the instructor.

Project C: Little Crab (First Game Program)

For this lab you develop a game by following instructions in the textbook. We will then use the process described in the textbook during class to start working on your first original game.

  1. Scan the textbook chapter 2 to get an overview of the material.

    It is important to have access to the book. If you have ordered the book but have not received it yet, then you can read chapter 2 online.

  2. Download the Book scenarios to a location on your computer where you will be doing your labs.

    Remember the location or make a note of where you saved the scenarios.

  3. Unzip the book scenarios file.

    See lesson 1.3.9 for unzipping instructions.

  4. Locate the chapter02-04 folder and open the little-crab project in Greenfoot.

    If the project asks if you want to automatically update your code, then click the Yes, update my code button.

  5. Complete the in-chapter exercises 2.1 through 2.18 that are listed throughout chapter 2.
  6. Follow the exercise steps exactly and read the textbook as you progress through the chapter to enhance your understanding. For the coding exercises, add the code stated in the textbook to the scenario files.
  7. For those exercises steps that have a written or text answer, open the Scenario Information (Scenario > Scenario Information) and type the exercise number and answer at the end of the file. For example, here are my answers to the first few exercises:
    Exercises with Text Answers
    2.1: Nothing happens.
    2.3: Number of pixels to move.
    2.4: All crabs move right.
    2.5: move(-5); will move backwards
    (answers needed for 2.1, 2.3, 2.4, 2.5, 2.7, 2.10, 2.11, 2.12, 2.13, 2.14, 2.18)

    Online access to the Actor class is available in the Greenfoot API.

  8. Add the following to the top of the Scenario Information:
    PURPOSE OF PROJECT: Book tutorial chapter 2
    VERSION or DATE: 1.0  date completed
    AUTHORS: Your name

    Change the date completed to the current date and Your name to your first and last name.

  9. When completed, zip all the little-crab scenario files into a single compressed folder and upload the zip file to Canvas as explained in the section of this document: Deliverables.


Project D: Review Concepts and Take Quiz

Complete the following steps to complete the first quiz:

  1. Review lesson 1 and lab 1 and the Self-Test questions below.
  2. Complete the B1: Taking Stock boss challenge (quiz) in Canvas to verify your understanding. Make sure to prepare before tackling the boss!
Self-Test Questions

Be prepared to answer questions like the following after completing this lab:

  1. True or false: to create action in a scenario we must write source code.
  2. We place commands for the Crab in the method named ________.
  3. To move forward 5 pixels write the command ________.
  4. To turn counterclockwise 3 degrees write the command ________.
  5. The name of the method described by the following declaration is ________.
    public void turn(int amount)
    1. amount
    2. int
    3. turn
    4. void
  6. True or false: the above method returns a value.
  7. The number of parameters defined for the above method declaration is ________.
    1. 0
    2. 1
    3. 2
    4. 3
  8. To call the above method, type the code ________.
    1. void turn(42);
    2. turn(42)
    3. turn(int 42);
    4. turn();
  9. The above method is defined in the class ________.
    1. Actor
    2. World
    3. Greenfoot
    4. none of these
  10. When you forget a semicolon at the end of a line you usually see the message ________.
  11. To make a decision we write a command known as a(n)________.
    1. if-statement
    2. method call
    3. method declaration
    4. parameter
  12. We execute the commands in an if-statement when the test condition, written inside the parenthesis, evaluates to ________.

Grading Criteria

The instructor will evaluate your lab using the following criteria. Thus you should check your lab against these criteria to maximize your XP.

Lesson Exercises (from Class)

  • 1: All lesson exercises attempted and turned in
  • 0: No lesson exercises turned in or wrong folder name

Greenfoot Installation

  • 1 point for describing your Greenfoot and Java installation in install.txt.
  • 1 point for describing how you tested the installation in install.txt.

Tutorial Lab (Textbook)

  • 4: Demonstrates mastery of the lab exercise:
    • Applies concepts from the textbook appropriately
    • Follows the steps exactly
    • Exercises perform correctly
  • 3: Has all the major functionality expected:
    • Implements many techniques from the textbook
    • May deviate from the specified steps in some way
    • Implementation seems more complicated than necessary.
  • 2: Has much of the functionality expected:
    • Demonstrates some techniques from the textbook
    • Deviates from the specified steps in some way
    • Implementation seems excessively complicated.
  • 1: Serious functional problems but shows some effort and understanding:
    • Follows at least 1/2 of the of the specified steps
    • Has a major error (detected by the browser) or many minor errors
    • Demonstrates few techniques from the lesson
  • 0: Not turned in or wrong folder name

CodeLab Exercises

Number completed correctly / number exercises * 8 and rounded up to the nearest integer.

Maximum XP: 15


CodeLab is submitted automatically, but other lab work must be submitted as described below.

  1. On your computer, create a folder for the lesson exercises named "lesson" (no extra characters) and place all the exercise files from Lesson 1 into this folder including:
    1. questions.txt
    2. wombat.txt
  2. Create a second folder named "tutorial" (no extra characters) and place your completed "little crab" folder from chapter 2 of the textbook into the tutorial folder. Include only one scenario which is the culmination of all the tutorial exercises from the textbook that you completed.

    Make sure to include the README.TXT file from the scenario. Do not turn in any other scenarios from the textbook.

  3. Place the install.txt file from this lab in the tutorial folder as well.
  4. Create a zip file with both folders named, or one zip file for each folder with the name of the folder, and submit the zip file(s) to the Lab 1 slot of Canvas.
  5. In addition, make sure you completed the:
    • B1: Taking Stock boss event (quiz) in Canvas.
    • CodeLab exercises.

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 files. For information on resubmitting see How do I change an assignment in Canvas?

Last Updated: September 10 2019 @00:06:40