EECS 183 Labs

EECS 183 Lab 1: Algorithms

Lab Due Wednesday, September 8, 2021, 12:59 pm Eastern

In this lab assignment, will write an algorithm to make a sunflower butter and jelly sandwich. While working on the lab, you will learn some of the tools you need to master the course beginning with Project 1.

Learning Objectives

Students should be able to identify that developing successful algorithms requires them to know the following:

Key Concepts

Assignment

Your task for this lab is to write an algorithm to make a sandwich. You should approach this problem by assuming that your algorithm will be given as a set of instructions to a robot that does not understand what a sandich is. That is, your algorithm should be taken literally and still be able to produce an edible sandwich.

Complete this lab in a group with 2-3 others. Find a way to write your algorithm somewhere everyone can contribute – whether a piece of paper, a Google Doc, or a laptop everyone can see.

How to write an algorithm

An algorithm is a series of steps used to solve a problem. An algorithm can be written with different language, but it must contain the steps required to solve the problem. You could write an algorithm using English (or any) language prose. However, it is more helpful to write an algorithm using pseudocode or alternately using a flowchart. Pseudocode is an informal description of an algorithm.

Write an algorithm for the problem using the pseudocode from lecture and lab as a guide. There is no universal pseudocode, and yours may look a little different.

Here is an example of pseudocode for making a sandwich. However, this is nowhere near as detailed as you will need to be.

Starter Sandwich Algorithm

  1. Take a slice of bread.
  2. Put sunflower butter on the bread.
  3. Put jelly on the bread.
  4. Take another slice of bread.
  5. Put the second slice of bread on the first.

Here’s a picture of a sandwich made with this algorithm, which will hopefully explain why you need to be more detailed!

Test Your Algorithm

If someone in your team has immediate access to the materials, try to execute the steps of the algorithm. Othwewise imagine going through the steps, preferrably using other objects to represent the items needed. Be as literal as possible in following the steps of your algorithm – try to make the silliest sandwich that literally follows the instructions. Test each part of your algorithm as you progress: preparing the bread before moving on to sunflower butter, applying sunflower butter before moving on to jelly, etc.

Grading

10 points for completion.

Implement your algorithm and submit with the lab form. Does your algorithm implement the features required by this specification? Would another person who has never made a sandwich be able to follow your detailed instructions?

Submission

When your team has completed your algorithm, each person must submit the following Google form to receive credit for the lab.