BU CAS CS 111: Introduction to Computer Science I

Spring 1998

Assignment 5
(due Friday 98.03.20 at 5 p.m. in room MCS 138)


  1. [4 points] Exercise 5.35, page 197.
    We want you to execute your program 3 times consecutively before handing it in.

  2. [4 points] Exercise 5.42, page 200.
    Your program must satisfy the following requirements:

  3. [4 points] Exercise 5.47, page 200.

  4. [4 points] Exercise 5.48, page 201.
    Modify the program as stated in the exercise. Then run it so that it reads a pair of positive integers from a date file (not from the keyboard). Test your program on the input file "data_file_for_hwk_5" in directory ~cs111/DataFiles, by executing the command:

    a.out < ~cs111/DataFiles/data_file_for_hwk_5

    at the Unix prompt. This date file contains 10 integers, all on the same line, where each two consecutive integers must be read together.


Assaf Kfoury
Created: 98.02.27