Exam 1 Study Guide

 

The exam will contain multiple choice, true/false, and one or two essay questions that will ask you to read and write small amounts of java code. 

 

It will cover the material in notes Week01_Notes01,02,03, Week02_Notes01,02 and labs 1 and 2.

Concepts to know

What is a variable – the name of a location in memory that stores a value.

 

What is the purpose of an assignment statement.

Which side contains an expression that produces a value.

Which side names the location where this value is stored.

 

How do you find the value of variables using the debugger.

 

Be able to look at a debugger screenshot and tell what the values of the variables were when the screenshot was taken, and based on that information, what would happen next in the code.

 

If statements

syntax – parentheses enclose the conditional expression

semicolons following the statements in the then and else branches, but no semicolon following the condition.

 

The ‘statement’ that is the then or else branch may be either a single statement or a block of statements.  This fact can get you into trouble …

 

If the statement for either the then or else branch is itself an ‘if’ statement, the outside if statement is a ‘nested if’ statement.

 

Given a nested if statement and an input, what will print

Be able to write a nested if statement to solve a problem similar to those given in lab.

 

Extra credit

 

See demos/loops0.pdf for loop practice problems.