Midterm 1 Review Quiz 08

Midterm 1 Review Quiz 08 - October2,2008 Groupmembers Rules...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 115 Midterm 1 Review Quiz October 2, 2008 Group members: Rules You must briefly explain your answers to receive partial credit. All snippets of code can be assumed to be enclosed within int main() . You can assume that the iostream , fstream , iomanip , string , and cmath libraries have been included at the beginning of the program. When you are asked to write a snippet of code, you may also assume that it is enclosed within int main() and that any necessary libraries have been included. When you are asked to write a complete program , you must write the #include statements, the int main() , etc. in your solution to receive full credit. A line consisting solely of “ ” represents one or more unspecified C++ statements, some of which may change the values of program variables.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Problem 1: 25 points. What is the output of each of the following segments of code? (a) int a = 2; cout << a; (b) int a = 2; cout << “a”; (c) int a = 2.5; cout << a; (d) bool b = (5 > 4) && (2 != 0); cout << b; (e) int a = 99; cout << a++; (f) if (5 % 4) { cout << “Baa!”; } else { cout << “Moo!”; }
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 6

Midterm 1 Review Quiz 08 - October2,2008 Groupmembers Rules...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online