{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

practice-midterm

# practice-midterm - CS106A May 7 2007 Time Limit 2 hours...

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

May 7, 2007 CS106A Time Limit: 2 hours Practice Midterm Examination Name ( please print) ____________________________________ Section Leader ____________________________________ General Instructions Answer each of the questions given below. Write all of your answers directly on the examination paper, including any work that you wish to be considered for partial credit. Each question is marked with the number of points assigned to that problem. The total number of points is 65. We intend that the number of points be roughly equivalent to the number of minutes someone who is completely on top of the material would spend on that problem. This leaves you with 55 minutes to spend more time and, if things go well, to check your work or to recover from false starts. The examination is open-book, and you may make use of any texts, handouts, or course notes. You may not, however, use a computer of any kind. There is a short reference sheet on the last page of the exam. The midterm exam will be held from 7:30 to 9:30 PM on the evening of Monday, May 7, in Annenberg Auditorium. Contact the course staff immediately if you have an unavoidable conflict with this time. score initials 1 _____/10 _____ 2 _____/15 _____ 3 _____/15 _____ 4 _____/10 _____ 5 _____/15 _____ Total _____/65

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

View Full Document
– 2 – Problem 1: InnerBorder Karel (10 points) In this program we write a Karel program which will create an inside border around the world. The border should be exactly 1-beeper high and should be inset by one square like this: Initial World State Final World State To keep things simple you may assume that the world is at least 3x3 squares. The correct solution for a 3x3 square world is to place a single beeper in the center square. Karel will always start in the lower-left corner facing East. We do not care about Karel’s final location or heading. You do not need to worry about efficiency. You are limited to the instructions in the Karel booklet—the only variables allowed are loop control variables used within the control section of the for loop.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 10

practice-midterm - CS106A May 7 2007 Time Limit 2 hours...

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

View Full Document
Ask a homework question - tutors are online