CPSC 120 Principles of Computer Science Fall 2025

Exam 2 Review Information

Topics

Exam #2 will cover material from approximately weeks 5-9 of the course: functions, conditionals, and loops. Arrays will not be on this exam. (Topics such as physics, particle systems, and boids will not be covered on any exams.)

The primary emphasis will be on the following new topics:

However, the course material is cumulative and "old" topics are unavoidable. You should expect to see any of the topics covered by the first exam (review information here) appear on this exam as well.

Format and Types of Questions

The exam will be in class, written (not on the computer), and closed book. You may have a single page of notes (8.5x11", one side) which will be handed in with your exam. This page may be handwritten or typed and can contain whatever you would like, but it must be a hardcopy — on a piece of paper, not a laptop, tablet, phone, or other device — and must be personally prepared by you — you may not copy another student's page or hand out copies of yours to others. Creating your own notes is an essential part of the learning process — deciding what to include requires engagement with the material which reinforces understanding and improves long-term retention of the material, provides an opportunity for review in order to identify gaps in your knowledge in time to ask questions before the exam, increases confidence in what you do know, and encourages taking ownership of your own learning.

For core concepts, expect short answer types of questions and questions similar to those on the in-class and lab worksheets. You should definitely expect to be asked to label pictures with the coordinates and sizes needing to draw the elements in the body of a drawing function and to answer the functions, conditionals, and loop questions for specific scenarios as was done on the worksheets for labs 4-8.

For programming elements, you will be asked to write code — this may take the form of writing a few lines of code to accomplish a specific thing or writing an entire (but short) sketch. You should be familiar with the syntax of the elements outlined in the topics above. You are expected to have correct syntax in any code written, but because you don't have the computer to point out problems, there is some leniency — the occasional small mistake such as a forgotten semicolon won't be penalized, but frequent mistakes of the same type or large errors that indicate a lack of understanding or knowledge of a particular syntax element will count against you.

How to Study

The best way to study for the exam is to practice as much as you can — work on the revise-and-resubmit for the labs if there are things you missed, and work on in-class exercises that you didn't get to or didn't finish in class for additional practice. Include both the worksheets and writing code in your practice.

To be fully prepared for the exam, you should know what to do for each question and be able to immediately start solving each problem — while being able to work out a solution eventually is an important fundamental, proficiency means that you are familiar with what to do and are able to spend your time constructing a solution rather than having to figure out how to go about solving the problem in the first place.