SCHOOL OF ENGINEERING AND COMPUTER SCIENCE

Past Tests and Exams for COMP102

This page has links to past tests and exams and model solutions for the last decade of COMP102.

Note that the course has changed over the years, especially in 2009 (moved to 15 points, had two smaller tests), and again in 2011 (changing from the comp100 library to the comp102 library with the UI class) so that tests and exams from previous years may not always match the current version of the course.


To interpret older tests/exams that didn't use the comp102 library, the following changes will generally be sufficient:

  • change System.out.print... to UI.print...
  • when reading input from the user, change scan.next...() to UI.next...() and delete Scanner scan = new Scanner(System.in)
  • change JOptionPane.showInputDialog(null, "prompt string") to UI.askString("prompt string")
  • change canvas.addMouseListener(this); to UI.setMouseListener(this);
  • change canvas.clear(); to UI.clearGraphics();
  • change canvas or this.canvas to UI (for all drawing commands)
  • change JButton ... = new JButton("..."); to UI.addButton("...",     this);
  • change actionPerformed(ActionEvent e){ String button = e.getActionCommand(); to buttonPerformed(String button){
  • remove anything with JFrame, frame, DrawingCanvas, Panel, JButton, addActionListener

Note also that brief Java documentation is provided with tests and exams (even when not included in the versions below).

Past Term Tests:

Do the tests before looking at the model solutions!!

Past Final Exams:

Do the exams before looking at the model solutions!

Note: Model answers are not available for exams before 2006.