CMPT166 Lab0: Template Lab Write-up

Problem Statement:

Display a running total of a sequence of integers entered by the user.


This is quite a trivial problem, well within the reach of a calculator (or Google!). However, the solution does illustrate how the problem-solving process works, from problem statement to design to implementation.

Problem Restatement:


This program uses the basic Java libraries. It is coded as a Java applet, and so uses the applet libraries.

Problem Refinement (natural language pseudocode):

  1. Input Section:
  2. Computation:
  3. Output:

Second Refinement (natural language pseudocode):

  1. Input
  2. Computation
  3. Output:

Data Table:

  • number (int): the integer value entered by the user
  • sum (int): the integer running total
  • input (TextField): text input widget for number
  • (it is not necessary to include all widgets here (e.g., prompt -- see code), just the ones used for computation)

    User Manual:


    Addition is a trivial little applet that keeps a running total of integers entered by the user.


    There is just one text box in the applet window: Type in an integer value and press Enter. It can be negative, but must not contain any decimal points, commas, or other non-numeric characters (letters, punctuation etc.).

    Each time you type a number and press Enter, the status bar will be updated to show the current running total. Keep entering numbers to see the status bar change.

    Test Cases, with expected results:

    Put some effort into designing your test cases; QA is a challenging job! The idea is that if your program passes all the test cases, you'd be confident shipping it to a paying customer.

    Normal Test case:

    Test case that breaks (invalid input):


    (Can be embedded here or left as separate files if you like, but list the filenames here.)
    This write-up is done in HTML as a webpage, and this sample lab is done as a Java Applet. If you do this as well, you may opt to embed your applet directly into your lab write-up. But you should still have static screenshots in your write-up.