Name: ________________________________ Section: _________________

Honor Code Acknowledgment: ___________________


Random Quiz # 3

CPS 100e, Fall 1995

Due: September 19


Problem 1: Sum like it hot (2 pts)

Write the function Sum whose header is given below.

( pay attention to the post condition )

  double Sum(const Vector<double> & nums, int numNums)
  // precondition: numNums = # of elements in nums
  // postcondition: returns nums[0] * nums[1] * ... * nums[numNums-1]
  //                this function is named very poorly









Problem 2 : What's my line? (2 points)

Succinctly, what's the difference in using getline(cin,s) compared to using cin >> s where s is a string?