Lab 2 - Spring 2021

The main purpose of this lab is to practice

  • using the Design Recipe to write functions
  • designing functions that use cond expressions
  • designing functions that use helper functions

How to get started

  1. Open a browser and copy/paste this URL:

  2. Login to Github and you will be prompted to accept this assignment
    1. After you click on the [Accept this assignment] button, you will see a new page display in your browser with the message:
      1. You accepted the assignment, Lab 2 . We're configuring your repository now. This may take a few minutes to complete. Refresh this page to see updates.
    2. After you refresh the page you should see a page with the message: “You're ready to go!”
    3. Note: this will create your own copy of Lab 2 for you to work on, but it's not on your computer yet.

  3. Click on the URL where your assignment repository has been created:
    1. you are now on the GitHub page for your Lab 2 repository

  4. Click on the green button to download your [Code]
    1. a “Clone” dialog box will appear, with the HTTPS tab underlined in red (if not, click on the HTTPS tab to select it)
    2. select the last option labeled “Download ZIP” and save it on your computer
    3. move the Lab 2 zip file from its download location to the cs101 folder that you created during lab last week.
    4. extract the contents of the zip file either by double-clicking on it or control-clicking on it and selecting the appropriate option to extract its contents
    5. navigate into your lab2 folder and confirm you see the lab2.rkt file there

Now you are ready to write some functions using the Design Recipe!

Your first program

  1. Launch DrRacket and open your lab2.rkt file, or just double-click on the file to open it in DrRacket.

  2. Fill in your name where <YOUR NAME> appears in the comments at the top of the program.

  3. Develop the functions for Exercises 1-4 as described in your Definitions pane.
    • solve each exercise in order: 1, 2, 3, and 4.
    • follow the steps of the Design Recipe for each function.
    • be sure your solution for each exercise includes all appropriate grading artifacts.

  4. When your program successfully runs, show it to me or one of our coaches and follow the procedure below to commit and push it back to GitHub.

Submitting your work

  • From your browser on the GitHub page for your Lab 2 repository, click on the [Add file] drop-down button and select “Upload files”
  • From your lab2 folder on your desktop, click and drag the lab2.rkt file onto your browser where it says, “Drag files here to add them to your repository”
    • just below the region of the webpage you should see you lab2.rkt file appear; it'll be just above the Commit Changes section of the page.
  • You are now ready to commit changes! Click on the green [Commit changes] button.
  • Your updated lab2.rkt file should now be in your Lab 2 GitHub repository.
    • ask a coach to verify this with you.