Lab 5

Purpose

Practice with unions

TA Pair Demo

A pair of TAs will demonstrate pair programming, solving the following problem from last weeks lab. Pay particular attention to how they work together, and how they follow the steps of the design recipe.

;; Design a function maybe-duplicate-string that takes in a String and a Boolean.
;; The function should return a String with two copies of the original String when the input Boolean is #true.
;; If the input Boolean is #false, the function should return the original String unchanged.

Find a partner

Find a new partner in the class. This should not be who you worked with in any previous week. Working effectively with people you don’t already know (and perhaps would not be friends with!) is an important skill to develop.

Demo

Over the course of this lab, you will build a program that behaves as the following:

Mouse Game

Starter File

Download lab5.rkt. Start working through this, carrying out pair programming like the TAs demonstrated. Be sure, every time you see the phrase “Design the function”, to follow all the steps of the Function Design Recipe. Stop when you get to the place where it says “STOP AND SWITCH WHO IS TYPING”.

Stop and Switch Who is Typing

An important part of pair programming is that the same person isn’t always typing. At this point, whoever was using the computer should switch. Also – indicate to the lab TAs that you are now ready for Code Review, which will take place on Problem 1.

Code Review

At some point before the end of lab, you should have a TA come over and review Problem 1. You should be able to explain, in no more than a minute or two, how your code works and why you made the choices you made. You and your partner will be explaining to separate TAs at the same time, so make sure you know, yourself, what you did and why: your partner will not be able to help you explain.

Continue with the Lab

Concurrent with the code review (which will proceed throughout the rest of the lab), work on Problem 2 & Problem 3.

Finished?

When you have completed all the exercises, you should submit the completed file to the Lab 5 assignment on Gradescope. You only need to submit one copy as a pair: have the submitter add the other partner to the group after submission. If you have trouble submitting it, ask a TA. Ensure that the autograder, which runs immediately, correctly validated your work, and if there are problems, correct them and re-submit.

Once you have submitted the problems, and have completed your code review, you are welcome to leave!