Lab 2 - Spring 2019

Designing Functions

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. Use your CS account to login to one of the Linux workstations in the classroom.

  2. Open a browser and copy/paste this URL: https://classroom.github.com/a/sarMECfD

  3. Login to Github and you will be prompted to accept this assignment
    1. Note: this will create your own copy of Lab 2 for you to work on, but it's not on your Linux account yet

  4. Open a terminal window.

  5. Create a new directory for this lab in your cs101 directory by entering the following at the Linux prompt:

    cd cs101
    mkdir lab2
    cd lab2

  6. Type the following commands to pull down a copy of this lab from GitHub:
    $ git init
    $ git remote add origin https://github.com/Vassar-cs101-mlsmith-spr2019/lab-2-yourVassarID
    $ git pull origin master



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

Your first program

  1. Launch DrRacket and open your lab2.rkt file

  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 a terminal window, type the following commands at the Linux prompt:

$ git commit -m "finished lab2" lab2.rkt
$ git push -u origin master



Log out

When you are done, close DrRacket and log out. Always remember to log out when you are done using the system, to ensure that no one else uses your account.

Assignment 1

I will soon have the first assignment posted. I will email the class when it is available. I encourage you to start the assignment as soon as you can so you can ask questions of me or the coaches.