CSCI 103 Fall 2017 Introduction to Programming

CSCI 103 Fall 2017: Introduction to Programming

Programming Exam

When: March 30th from 7-8:30 PM

Where: [Read carefully below which room you will be in]

Laptop and Wireless Concerns

Be sure to charge your laptop in advance. Also if classroom wireless issues cause problems, do not freak out. We will deal with the problem as best we can and arrive at a fair solution.

Downloading Ahead of Time

We will post skeleton code, a Makefile, and a few samples in an encrypted .ZIP file about 15-minutes prior to the exam. We will email download instructions at that time so you can download the zip file to your machine. and be ready to start at 7 p.m. when we hand out the test. The ZIP file will require a password to decrypt/extract. That password will be provided on the midterm handout at 7 p.m. We post the ZIP file ahead of time so that we don't have unneeded wireless traffic or slow-server response time at the start of the exam. Please download the .ZIP file in advance once we send out the email.

Academic Accommodations

If you have academic accommodations you need to talk to your instructor right away to find the location for the exam.


The programming exam will be like a small assignment. We will give you a description of some task(s) and maybe some starter files, and you will be asked to write one or more programs and upload them to the course website. Like an assignment, basic checks can be run on demand, but more thorough testing will be done during grading.

The exam is:

The exam will likely run for 90 minutes.


This list of topics is tentative.

All the topics from the written midterm, prior PAs, prior Labs, and prior HWs may appear on the exam. So the main topics are data types, loops, conditionals, arrays, functions, dynamic memory/pointers, objects, file I/O, and basic input/output. Be sure you are comfortable with:


Simple Tasks You Should Be Able To Do

Previous and Related Programming Exams

Here are some practice materials. Note that the topics they cover might be slightly different from our list of topics.

We suggest you consider the following material from Princeton University, which has a similar programming exam, though in a different language. Naturally, you should practice them in C++ and not Java.

  1. Practice Exam 1: Foodlympics. The test files are available here.
    • The C++ versions of the prototypes should be:
    • int score(int judgeRatings[], int J) // J: number of judges
      string best(string countries[], int C, int scores[]) // C: # countries
    • You can assume there are at most 100 judges and at most 100 countries.
    • Use  #include <cmath> to access the round function of C++.
  2. Practice Exam 2: Snow. The test files are available here.
    • The C++ versions of the prototypes should be:
    • double meltage(double currSnow, int temp, int salt)
      void printArray(double arr[], double length)
    • You should use to detect the end of input.
    • For part 2, you can assume there are at most 100 scenarios.
    • Use #include <iomanip> and cout << setw(8) << setprecision(3) << x to print the double x in the right format.
  3. Practice Exam 3: Hats. The test files are available here.
    • The C++ versions of the prototypes should be:
    • bool isD(int r[], int length)
      int maxCycleLength(int arr[], int N)
    • You can assume the permutation length is at most 100.
    • You should use to detect the end of input.
  4. Practice Exam 4: Birthdays.
  5. Practice Exam 5: Restaurants. We won't ask you to sort data on the real exam. But, it is good practice.

Short Practice Problems

In case you want some practice that takes less than 90 minutes, here are 5 smaller exercises (use "Select an Exercise"):


Medium to Challenging: