CS 149: Programming Fundamentals 
James Madison University, Fall 2017 Semester 

Exam #2 logistics and preparation

Current Materials

The following samples will give you a good idea of the structure and length of exams. Sample exams are not a study guide. In other words, they do not provide information about what you should and/or shouldn't study.

Note that the answers to the sample exams will not be made available. This is to help you avoid focusing too much attention on the specifics of these questions. (These samples were developed by Prof. Bernstein.)

image Sample Written Exam

 Sample Computer Exam

Old Materials (USE AT YOUR OWN RISK)

As a reminder, the midterm will consist of two parts (50 minutes each): a written exam on Wednesday, and a coding exam on Friday. You are encouraged to study all previous activities and labs, textbook chapters and reading quizzes, and programming assignments. On Monday you will receive a printed copy of the following materials, so come prepared to work through them with your team. The solutions will NOT be posted.

 Sample Written Exam (Fall 2015)

 Sample Coding Exam (Fall 2015)

IMPORTANT! For last year's class, the chapter on strings was part of Exam 2 and the chapter on arrays was part of Exam 3. Thus you should expect more emphasis on array questions this year than on the string methods included in the sample exam.

Written Exam


Students will be able to...

  • Recognize vocabulary/concepts from Ch5-9.
  • Evaluate relational and conditional expressions.
  • Predict the output of simple recursive methods.
  • Trace by hand the values of variables in a loop.
  • Declare, instantiate, and assign arrays of integers.
  • Write methods that require loops and decisions.


  • This is a closed-book, closed-notes, no-calculator exam. Do not refer to any materials other than the exam itself.

  • Do not look at anyone else's exam. Do not talk to anyone but the instructor during the exam. Turn off all cell phones, etc.

  • Use the restroom and take care of personal needs before you arrive. If you need to leave during the exam, ask for permission.

Coding Exam


Students will be able to...

  • Meet any objectives from PA3 and PA4.
  • Compute stats over an array of doubles.
  • Write nested/chained if-else statements.


  • You must use a Linux lab machine and log in with your JMU account (not student). It's strongly recommended that you practice the sample exam in the lab so there will be no surprises on Friday.

  • During the exam, you may access materials on the course website including prior activities, lab instructions, and the textbook. However, you may not watch any of the videos or click on links to external websites.

  • You may only run the following programs: DrJava (or other editor), a terminal, and a web browser. All windows should be arranged so that the instructor can see what you're doing.

  • The use of any pre-existing code (other than that provided as part of the exam), other documents/pages/sites, and/or other programs will be considered a violation of the Honor Code.

  • At the end of the exam, you will submit your code via Web-CAT. You may not use Web-CAT for any other purpose (e.g., looking at code from prior assignments) during the exam.

Video Tutorial

Back to Top