F09_10A_key1

F09_10A_key1 - Exam 1, 10/26/09 PIC 10A, Fall 2009 KEY...

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

View Full Document Right Arrow Icon
Exam 1, 10/26/09 PIC 10A, Fall 2009 KEY Check your discussion section: _____ 2A Kree 1:00 _____ 2B Brian 11:00 _____ 2C Alejandro 12:00 _____ 2D Jacob 12:00 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 8 2 8 3 8 4 13 5 13 TOTAL 50
Background image of page 1

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

View Full DocumentRight Arrow Icon
1 1.) [2 points] Frodo is programming a tic-tac-toe game. Once the game is finished, he asks the user if they want to play again and stores their answer in a string variable called response. He checks if they entered upper or lower-case "y" and repeats the game using the following loop: while (response == "y" && response == "Y") The program compiles, but it doesn't seem to run properly. Explain what the error is and what happens in the program. It is impossible for a string to equal both upper and lower-case "y", so this loop will never
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.

Page1 / 6

F09_10A_key1 - Exam 1, 10/26/09 PIC 10A, Fall 2009 KEY...

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