Exam 1, 2/2/09 PIC 10A, Winter 2009 KEY Check your discussion section: _____ 1A Vladimir _____ 1B Darren You have 50 minutes to complete this exam. You are not allowed to use any books, notes, calculators, or electronic devices. Write your answers carefully. Incomplete, unintelligible, or illegible answers will receive little or no credit. When you are asked to write a program, it is not necessary to comment your code but you are expected to indent appropriately to make your code easier to follow. There are a total of 50 points on this exam. PAGE SCORE POSSIBLE 1 6 2 6 3 12 4 13 5 13 TOTAL 50
1 1.)[2 points]In lecture we discussed that we can repeatedly read in numbers from the user using the loop while (cin >> x) where x is a number valued data type like int or double. Explain why this loop would not be appropriate for reading in a list of words when x is a string.