CPSC 124, Spring 2006
Information about Test #1

The first test for this course will take place in class on Friday, February 17. It will cover Chapters 1, 2, and 3 from the textbook and Labs 1 through 5. We did not cover everything from Chapter 1 in detail; you are only responsible for what we covered in class. A lot of graphics commands were used in the labs, but you are only responsible for knowing how to use the few that are listed below.

The test will include some short answer questions, similar to those that were given on quizzes. There might be one or two longer essay questions. There will certainly be some programming problems. Some of these will ask you to write short segments. There will probably be one question that asks you to write a complete program, so you should be sure that you know the format for that, including the "public static void main(String[] args)". You might be asked to read some code and say what it does. You should make sure that you have memorized the syntax of all the different types of statements and expressions that we have covered.

Here are some of the terms and ideas that you should be familiar with:


    CPU                                  Math.sqrt(x)
    RAM                                  Math.pow(x,y)
    computer program                     Math.random()
    programming language                 str.length()  [ for a String str ]
    machine language                     str.charAt(i)
    high-level language                  str.equals(s2)
    compiler                             str.equalsIgnoreCase(s2)
    interpreter
    Java Virtual Machine                 System.out.print(x)
    Abstraction                          System.out.println(x)
    defining Java classes
    .java and .class files               TextIO.getInt(), TextIO.getlnInt()
    main() subroutine of a program       TextIO.getDouble(), TextIO.getlnDouble()
    syntax                               TextIO.getChar(), TextIO.getlnChar()
    semantics                            TextIO.getBoolean(), TextIO.getlnBoolean()
    pragmatics                           TextIO.getln()
    variables
    variable declaration statements      arithmetic operators: +, -, *, /
    types                                using  /  for integers
    primitive types                      the  %  operator for integers
    int, double, char, boolean           using  +  with a String
    String                               comparisons  ==, !=, >, <, >=, <=
    literals                             logical operators  &&, ||, !
    identifiers                          ++  and  --
    subroutines                          +=, -=, *=, etc.
    assignment statements                (int)(N*Math.random())
    expressions                          (char)N
    operators                            (double)N
    precedence of operators              (int)ch
    type cast
    control statement                    g.drawLine(x1,y1,x2,y2)  [ for g of type Graphics ]
    block statement                      g.drawRect(x,y,width,height)
    empty statement                      g.fillRect(x,y,width,height)
    while statement                      g.drawOval(x,y,width,height)
    do..while statement                  g.fillString(x,y,width,height)
    for statement                        g.drawString(str,x,y)
    if statement                         g.setColor(c)
    switch statement                     Color.RED, Color.BLACK, Color.GREEN, ...
    break statement
    algorithm                            JApplet, JFrames, and JPanels
    pseudocode                           computer animation
    stepwise refinement                  frames of an animation
    debugging
    GUI                                  nedit, javac, and java commands

David Eck, February 2006