Comp 110

1st Mid Term

Study Guide

           

  1. Introduction to Computers, Programs, and Java
    1. What are the main components of the computer?
    2. Difference between:

                                          i.    Machine language

                                         ii.    Assembly language

                                        iii.    High-level language

    1. What is a compiler?
    2. Convert numbers between decimal, binary, octal, and hexadecimal
    3. Explain the concept of keywords in Java
    4. How are comments implemented in Java?
    5. Explain the import statement in Java?
  1. Elementary Programming
    1. The basic structure of a Java program (including conventions for showing structure)
    2. How to construct valid identifiers
    3. What are the Java keywords?
    4. Declare variables in Java
    5. The benefits of using constants
    6. The assignment and arithmetic operators in Java

=, +=, -=, *=, /=, %=

+, -, *, /, %, ++, --

    1. Writing assignment statements
    2. Writing and evaluating arithmetic expressions (including the use of parentheses)
    3. Numeric data types

                                          i.    byte

                                         ii.    short

                                        iii.    int

                                       iv.    long

                                        v.    float

                                       vi.    double

    1. Numeric literals
    2. Numeric type conversions
    3. Evaluating arithmetic expressions with mixed type variables
    4. The character data type and operations on characters (e.g., +)
    5. Character literals
    6. Printing special characters like \ and
    7. The String type
    8. Naming conventions for class names, method names, constants, and variables
    9. Differences between

                                          i.    Syntax errors

                                         ii.    Runtime errors

                                        iii.    Logic errors

  1. Selection
    1. The boolean data type
    2. Comparison operators

            <, <=, >, >=, ==, !=

    1. Boolean operators

!, &&, ||, ^

    1. Writing and evaluating Boolean expressions

    2. Writing and evaluating if statements (including proper indentation)

                                          i.    With and without else clauses

                                         ii.    Nested if statements

    1. How to use the random() method
    2. Writing and evaluating switch statements

                                          i.    Data types for the switch variable

                                         ii.    Use of the break statement

                                        iii.    Use of the default case

                                       iv.    Converting between switch and if statements

    1. How to format output
    2. Operator precedence and evaluating expressions
  1. Loops
    1. The structure of loops

                                          i.    The while loop

                                         ii.    The do-while loop

                                        iii.    The for loop (what are the three parts for controlling the loop)

    1. Scope of loop variables
    2. Explain what’s going on in a loop
    3. Write a loop or a nested set of loops to solve part of a problem
    4. Convert one kind of loop into another
    5. Loop control using break and continue
  1. Methods
    1. Benefits of using methods
    2. How are methods declared?

                                          i.    Method header

1.    Modifiers

2.    Return value type

3.    Method name

4.    Parameters

    1. Method signature and arguments
    2. How are methods invoked?
    3. Returning values from methods (the return statement)
    4. Passing parameters by value
    5. Overloading methods
  1. General
    1. Be able to specify the design of an algorithm (in words)
    2. Be able to explain and use style guidelines for Java programs
    3. Be able to explain and use commenting guidelines for Java programs
    4. Be able to read a Java program and explain what it does
    5. Be able to look at Java code and find errors
    6. Be able to modify Java code to solve a similar problem
    7. Be able to explain the four main constructs used in building algorithms or programs

                                          i.    Sequence (series)      

                                         ii.    Selection (choice)

                                        iii.    Loop (iteration)

                                       iv.    Method (subprogram)