EECS 183 Labs

EECS 183 Lab 4: Loops

Lab due on your scheduled lab day

Lab accepted for full credit until Monday, February 14, 2022, 11:59 pm Eastern

In this lab, you are writing code and solving practice exam questions to master the use of loops.

By completing this lab assignment, you will learn:

Prerequisite

You will need to use and be able to understand RMEs (Requires, Modifies, Effects) to complete this lab. You can find a reference for RMEs on Google drive here. You should complete this lab in small groups of about 4 students. For all labs in EECS 183, to receive a grade, every student must individually submit the Lab assingment.

Starter Files

You can download the starter files using this link.

The IDE setup tutorials for Visual Studio and XCode include a video about how to set up a project using the starter files. You can access the tutorials here:

After downloading and unzipping, you will find the following files in the starter-files folder:

IMPORTANT: For this lab, you must include all three files in a single project in Xcode or Visual Studio.

Lab Assignment

Tasks to Complete

  1. Start a new project with your IDE using the starter files according.
  2. Stub all of the functions in loops.cpp - see Function Stubs for details.
  3. Write your test cases in test.cpp to test the print functions you will implement in loops.cpp.
  4. Write the implementations for the functions in loops.cpp:
    • printRectangle()
    • printRight()
    • printRightJustified()
    • printIsosceles()
  5. Test your functions using the test cases you have written.
  6. Submit your loops.cpp and test.cpp to the autograder.

Multiple Files

Function Stubs

A function stub is a temporary substitute for a to be implemented function. In all projects and labs so far in EECS 183, we have provided all of the function stubs for you. Starting with this lab, you will need to create function stubs for all of the functions you will implement.

void printRectangle(int rows, int cols) {
    // TODO - implement
    
    return;
}

Testing

Bugs To Expose

There are a total of 4 unique bugs to find in our implementations of loops.h functions. Your tests will need to expose all of the bugs to receive full points for the lab. The autograder will tell you the names of the bugs that you have exposed, from the following set:

loops.cpp

IMPORTANT: Differences in whitespace do matter for the functions that you will define in loops.cpp.

You will create function definitions for the following functions, all declared in loops.h:

Everything you need to be able to define these functions is found in the RME’s in loops.h.

You can find a reference for RMEs on Google drive here.

How to Submit

IMPORTANT: For all labs in EECS 183, to receive a grade, every student must individually submit the Lab Submission. Late submission for Labs will not be accepted for credit. For this lab, you will receive ten submissions per day with feedback.