CSC 221: Computer Programming I
Test 1 Review


Tue, Oct 6
  • The test will include extra points (Mistakes Happen!), e.g., 52 or 53 points, but graded on a scale of 50.

Types of questions
  • factual knowledge: TRUE/FALSE, multiple choice

    TRUE or FALSE: The three main components in the von Neumann architecture are the CPU, memory, and input/output devices.
  • conceptual understanding: short answer, discussion

    Can a Java class have more than one constructor? If so, describe an insteance where mulitpile constructors might be useful. If not, explain why multiple constructors would not make sense.
  • synthesis and application: explain/debug code, trace/modify code

    Modify the provided Die class so that each die has a color. You will need to specify the color when you construct a Die object, and there should also be an accessor method that allows you to access the color of a Die object.
Study advice
  • review online lecture notes (if not mentioned in class, won't be on test)
  • review text
  • look over quizzes, homework assignments
  • reference other sources for examples, different perspectives
Course Material Overview & history hardware vs. software historical generations mechanical -> vacuum tube -> transistor -> IC -> VLSI -> parallel & networks evolution of programming machine language -> assembly language -> high-level language Programming in Scratch programming concepts simple actions: move, turn, next-costume, ... repetition: forever, repeat, ... conditional execution: if, if-else, repeat-until logic: =, >, <, and, or, ... arithmetic: +, -, *, /, ... sensing: touching?, key-pressed?, ... variables: set, change-by, ... coordination: broadcast, when-I-receive, ... object-oriented concepts class = sprite template object = sprite instance fields = properties of a sprite (e.g., size, location, direction, ...) methods = blocks/scripts that defined actions parameters = values entered in boxes (e.g., turn ? degrees) Using Java classes loading a BlueJ project, creating an object, inspecting an object's state calling a method, parameters, data types (String, int, double, ...) Java class definitions fields define state; constructors initialize; methods implement behaviors public (class/constructor/methods) vs. private (fields) accessor vs. mutator methods, void methods comments (/** ... */ or // ..) variables and memory fields vs. parameters vs. local variables Java statements assignment statements, expressions (using +,-,*,/) System.out.print, System.out.println, + operator return statement required in all execution paths of non-void method method calls internal (one method calls another): this.METHOD(PARAMETERS) external: right-click and select the method (in BlueJ)