Skip to main content

CISC 3115 Introduction To Modern Programming Techniques

Fall 2018

by Professor Hui Chen, CUNY Brooklyn College

Section TY3

Class Meeting: 03:40 - 05:20pm, Tuesday and Thursday
Classroom: Room 130 Ingersoll Hall Extension (IA-130)

Acknowledgement

This review guide is adopted from Professor Gerald Weiss with minor revision.

Review Topics III (3 of 3 and Final Review)

The Structure of the Exam

  • For all topics, you should be able to trace, analyze, and write Java code.
    • Questions will for the most part consist of:
      • presenting you with a piece of code and asking you what is output — or what the value of one or more variables are — once the code is executed
      • presenting you with a problem description and asking you to write the corresponding code
      • asking you what is wrong with a piece of code and/or asking you to repair it
      • presenting you with a piece of code and asking you to trace the value of one or more variables as the code is executed
    • There may also be some multiple-choice and short answer questions.
  • Although you will not be asked for definitions of terms, you should know them as they will be used in the text of the questions.
  • While the book is a good supplement, you are only responsible for topics and material in the lecture notes and the various exercises and assignments. These are a great way for you to prepare yourself for the exam.

Topics in Reviews I and II

Abstract Classes and Methods

Interfaces

Recursion

  • escape clauses
  • Recursive calls
  • Recursion on integers, arrays, strings
    • You should be able to code simple recursive methods, including those covered in class and the notes
  • Using lower/upper bounds for recursive methods involving arrays and strings
  • Introducing a wrapper method between the user and the actual recursive 'workhorse' method

    int binsrch(int [] arr, int val) {return binsrch(arr, 0, arr.length-1);

    int binsrch(int [] arr, int lo, int hi, int val) {…}

  • Fibonacci, binary search, towers of hanoi
    • You need to be able to write the above methods (pseudocode is fine)

Command-line Arguments

Collections

  • Java's notion of the Collection, a List, a Set, and a Map interfaces.
  • The Iteratable and Iterator interfaces
  • How to iterate over a collection (without using the enhanced for loop) -- i.e., for (Iterator iter = …
  • superclasses/subclasses, superinterfaces/subinterfaces, classes implementing interfaces
  • Why putting thing into a (raw) collection is an upcast, while removing from a collection requires a downcast
  • constant/linear/log/quadratic operations
  • The basics of various collections: ArrayList (resizeable array) Stack (LIFO), Queus (FITO), LinkedList (linked nodes for constant insertion), PriorityQueue (removed in priority order), TreeSet, HashSet, TreeMap, HashMap
  • The difference between the Hash and Tree versions of Set and Map
  • Using an ArrayList: add, get, iterator, set, addAll
  • Using a Map: containsKey, get, put, keySet
  • Autoboxing
  • Raw vs generics
  • The enhanced for loop

JavaFX

  • applications, stages, scenes, nodes, panes, shapes
  • layout: HBox, VBox, GridPane, BorderPane
  • event handling: events, event sources, event-handler methods, listeners, registering for an event (setOnAction), the Event object
  • You should be able to code a simple application involving buttons and text fields and/or shapes

Projects

  • You should be able to answer questions about the project, e.g. how the ArrayList or Map was used, how the data was read in , etc.