CSCI 132 Data Structures--Spring 2014

    Home | | Syllabus | | Assignments | | Lecture Notes

    Laboratory 2 Solutions

    List of errors:

    /*******************************************************************
    * Name: Brenda Student
    * Date: 1/28/14
    * Course: CSCI 132
    * Assignment: Lab2
    * Instructor: Royden
    *******************************************************************/
    
    List of errors in code:
    Compile errors:
    1) Declaration of class Life is missing a semicolon at the end in life.h
    2) Missing a prototype for the instructions function in playLife.cc
    3) First cout in instructions function uses a < instead of a << in playLife.cc
    4) int row, col is missing a semicolon in the initialize function in life.cc
    5) The print function is missing the scope resolution operator (Life::) in life.cc
    
    Runtime error:
    1) In neighbor_count the first for loop has i < row+1 instead of i <= row+1.
    

    Solutions to programs:

    life.h

    life.cc

    playLife.cc

    life1.h

    life1.cc


    Home | | Syllabus | | Assignments | | Lecture Notes