Past Tests and Exams for COMP102

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

Note that the course has changed over the years. Significant changes were
  • 2015: Changed ecs100 to use Java 8 - simplifies user interface code (adding buttons, etc).
  • 2014: Changed balance of questions in tests and exam. Changed name of library from comp102 to ecs100 (no internal changes)
  • 2013: Introduced ArrayList in addition to arrays
  • 2011: changing from the comp100 library to the comp102 library with the UI class
  • 2009: moved to 15 points, had two smaller tests, dropped recursion as an assessable topic
These changes mean that tests and exams from previous years may not always match the current version of the course.

Note also that brief Java documentation was provided with tests and exams (not included in the versions below) but changed from year to year.

For effective learning, do the tests/exams before looking at the model solutions!!

If you find the model solutions wrong, test it yourself by running the code and also email us.

2019 Tri 2

2019 Tri 1

2018 Tri 1

2017 Tri 2

2017 Tri 1

2016 Tri 2

2016 Tri 1

2015 Tri 2

2015 Tri 1

2014 Tri 2

2014 Tri 1

2013 Tri 2

2013 Tri 1

2012 Tri 2

2012 Tri 1

2011 Tri 2

2011 Tri 1

Exams and tests before 2011

(Links to exams and tests continue below)

To interpret the following older tests/exams that didn't use UI and the ecs100 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

2010 Tri 2

2010 Tri 1

2009

2008

2007

2006

2005

2019 Tri 1

Test2

  • 102-test2-total.png:
    102-test2-total.png

  • 102-test2-Q1.png:
    102-test2-Q1.png

  • 102-test2-Q2.png:
    102-test2-Q2.png

  • 102-test2-Q3.png:
    102-test2-Q3.png

  • 102-test2-Q4.png:
    102-test2-Q4.png

  • 102-test2-Q5.png:
    102-test2-Q5.png
Topic attachments
I Attachment Action Size Date Who Comment
102-test-Q2.pngpng 102-test-Q2.png manage 3 K 09 Apr 2019 - 09:29 Main.xgao  
102-test1-Q1.pngpng 102-test1-Q1.png manage 3 K 09 Apr 2019 - 09:29 Main.xgao  
102-test1-Q3.pngpng 102-test1-Q3.png manage 4 K 09 Apr 2019 - 09:29 Main.xgao  
102-test1-Q4.pngpng 102-test1-Q4.png manage 4 K 09 Apr 2019 - 09:30 Main.xgao  
102-test1-Q5.pngpng 102-test1-Q5.png manage 4 K 09 Apr 2019 - 09:30 Main.xgao  
102-test1-total.pngpng 102-test1-total.png manage 3 K 09 Apr 2019 - 09:29 Main.xgao