CS 18000 Midterm: CS18000 Exam 1 2009 Fall with Solutions

46 views14 pages

Document Summary

There are 3 programming questions worth a total of 60 points. Answer the multiple choice questions on the bubble sheet given and the programming ques- tions on the exam booklet. Fill in the instructor, course, signature, test, and date blanks. Fill in the bubbles that correspond to your name, section and student id in the bubble sheet. For your section number, use the section number for your lab and project turn in. For your student id, use the 10 digit id number on your student id card. Exams without names will be graded as zero. Only the answers on the bubble sheet will be counted. System. out. print(x); (a) 40 (b) 10 (c) 15 (d) 35: what is the output of the following code? int x = 5; int y = 7; while (x < ++y) x += 2; System. out. print("x=" + x + " y=" + y); (a) x=9 y=9 (b) x=9 y=8 (c) x=11 y=10 (d) x=11 y=11.