CS 124, Spring 2021
Information on the First Test

The first test for this course will be administered through Canvas during the regular class time on Friday, February 26. Instead of coming to class on that day, you should sign into Canvas and take the test. The test will be available starting at 9:45 AM. The test is timed. You will have up to 70 minutes to complete the test.

The test is designed to be closed book. It will be given on the honor system. You will be asked to affirm that, during the test, you have not consulted the textbook, your notes, the Internet, other people, or any other source of information.

The test will cover material from the textbook, plus material from the labs about drawing with JavaFX. From the textbook, this includes: Sections 1.1 and 1.3 from Chapter 1; Sections 2.1 through 2.5 from Chapter 2 except for subsections 2.3.4, 2.3.5, 2.4.4, 2.4.5, 2.4.6, and 2.5.5; and Sections 3.1 through 3.5 from Chapter 3 except for subsections 3.1.4 and 3.3.2.

Note that you will not be asked about: printf, the Scanner class, files, operator precedence, do..while statement, continue statements, labeled break statements, switch statements, or anything covered in the week of February 22. You will not be asked about specific examples,such as the 3N+1 problem, interest rate computations, or counting divisors that are covered in the text.

You are not expected to memorize every JavaFX subroutine or every subroutine from the Math, String, and TextIO classes. See the list of specific subroutines, below, that you might encounter on the test. You do not have to memorize "public static void main(String[] args)".

Questions on the test can include definitions, longer essay questions, writing Java code segments, and reading Java code and determining what it does. There are no multiple-choice or true/false questions.

Here is a list of some of the things that you should know about:

computer programs
machine language
high-level programming language
Java bytecode
Java Virtual Machine
syntax errors (found by compiler) vs. semantic errors (seen at run time)
style rules and why they are important
style rules for variable names and class names
formatting and indentation of programs
comments in programs

identifiers (for names of variables, subroutines, and classes)
data types
Java's primitive types:  int, double, char, boolean
the String type
Java literals of various types (numeric, char, String, boolean)
special characters in char and String literals, such as '\n' and '\t'
the basic idea of binary numbers  (strings of 0's and 1's)
assignment statements
type compatibility rules for assignment statements
declaring variables
subroutines, and "calling" a subroutine such as System.out.print or g.fillRect
parameters in subroutines, such as the x in System.out.println(x)
functions: subroutines that "return a value"
comparing Strings with str.equals(str2) instead of str == str2
System.out.print(x), System.out.println(x), and System.out.println()
getting input from the user
important operators:
      + - * / %    == < > != <= >=    && || !    ++  --    =  +=  -=  *=
type-casting, especially using (int) and (double) for type-casting numbers
making random integers:  (int)( m * Math.random() + n )
how the / and % operators work for integers; using n % d to test if d evenly divides n
using the + operator with a String

control structures
loops and branches
infinite loop
algorithm (the most basic object of study in computer science!)
the empty statement:  ;
block statement:      { }
while statement:      while ( condition )  { statements }
for statement:        for ( initialize ; condition ; update ) { statements }
simple if statement:  if ( condition ) { statements }
if..else statement:   if ( condition ) { statements } else { statements }
if..else if... statements
flag variables
using while(true) loops
using break in a loop
processing the characters in a String using a for loop
nested for loops

the xy coordinate system that is used for drawing
basic color values:  Color.RED, Color.GREEN, Color.BLUE, Color.WHITE, etc.

JavaFX drawing subroutines you should know:
      g.strokeRect(x,y,w,h), g.fillRect(x,y,w,h),
      g.strokeOval(x,y,w,h), g.fillOval(x,y,w,h).
      g.setFill(color), g.setStroke(color)
functions that you should know from the Math class: 
      Math.random(), Math.sqrt(x), Math.floor(), Math.pow(x,y)
functions that you should know for a String, str:
      str.length(), str.charAt(i), str.indexOf(ch), str.equals(str2), str.toUpperCase()
TextIO input functions that you should know:
      TextIO.getln(), TextIO.getlnInt(), TextIO.getlnDouble()