Exam1s09part2_w_solutions

Exam1s09part2_w_solutions - EAS 230 Exam 1 PART 2 Problems...

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

View Full Document Right Arrow Icon
PART 2 Problems 11-20 March 2, 2009 7:00 PM Circle the correct output of the following program in the box. Question 11 int main() { char read; int i; ifstream datain("wishes.txt"); for (i=0; i<4; i++) { datain >> read; } cout << read << endl; system("pause"); return 0; } "wishes.txt" GOOD LUCK ON THE EXAM! * A. ON B. THE C. D D. * Question 12 bool status(int, int); int main() { int strike=0, ball=0; bool out = false; int pitch=1; while(!out) { if (pitch%2 == 0) { strike++; } else { ball++; } out=status(strike, ball); pitch++; } cout << ball << endl; system("pause"); return 0; } bool status(int s, int b) { if (s==3){ return true; } else { return false; } } A. 0 B. 1 C. 2 D. 3 Question 13 int main() { int i; double x=10; i=1; x=pow(pow(x,i/x),x); cout << x << endl; system("pause"); return 0; } A. 0 B. 1 C. 10 D. 10000000000 Your Name:___________________________________ Your UBIT Name:_______________________________ Your Section Circle One: (A1, A2, A3, A4, B2, B3, B4)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/28/2011 for the course CSE 230 taught by Professor Harvey during the Spring '11 term at SUNY Buffalo.

Page1 / 4

Exam1s09part2_w_solutions - EAS 230 Exam 1 PART 2 Problems...

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

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