Lab 4

CS 1005, C0term 03

February 5, 2003

Problem

You are to complete a partially-written program by providing a function that will sum all the integers in a given range. The user provides the lower and upper bounds of the range. For example, if the user specifies 6 for the lower bound and 12 for the upper bound, the program will print the number 63 (the sum of the numbers from 6 to 12).



What you should do...

  1. Sign the attendance sheet.
  2. Copy the partially-completed program to your directory:
    cp /cs/cs1005/labs/lab4/lab4.cxx .
  3. Complete the program by writing the function that calculates the sum. You will also need to insert the function prototype and the function call into the program.
  4. Use the `script' command to record your program executing. Name your script file lab4.script.
  5. Turn in the `.cxx' file and your script file, using the turnin program. Use the following syntax at the UNIX prompt:
    /cs/bin/turnin submit cs1005 lab4 lab4.cxx lab4.script



Glynis Hamel 2003-01-17