Name: ________________________________ Section: _________________

Honor Code Acknowledgment: ___________________


Random Quiz # 5

CPS 6, Fall 1995

Due: September 18


Problem 1: A sign from the heavens (2 pts)

What is printed by the following code segment? (hint: it's tricky)

       int num = 5;
       int prod = 8;
    
       if (prod = num)
       {
          cout << "equal" << endl;
       }
       else
       {
           cout << "different" << endl;
       }

Justify, in one or two sentences, your answer for the previous problem.

Problem 2 : Howard's Stern (1 point)

The function AdjustAltitude, part of the class Balloon, is in the private section of the class. This means that (circle one)