Honor Code Acknowledgment: _____________________________
Due: Thursday, May 27, 1999 6 points
Consider the following lines of code.
string name;
int a, b;
cin >> name;
cin >> a >> b;
cin >> b;
cout << "name " << name << endl;
cout << "a is " << a << endl;
cout << "b is " << b << endl;
If the user types the following input:
Knuth 5 8 2 4
What is the output?
What is the output of the following cout statements?
cout << 5 + 3 * 4 << endl;
cout << 5 * 3 + 4 << endl;
cout << 23 % 6 % 8 << endl;
cout << 45 / 10 << endl;
cout << 45.0 / 10 << endl;
cout << 10 - 2 * 8 - 4 << endl;
What is wrong with the following statements in a student program (see the complete Balloon class in section 3.4)?
Balloon devil;
devil.Burn();
devil.Ascend(10);
devil.Vent();
devil.Descend(10);