Final Exam Topics CS100J Spring 2001 Overall: + All topics from all Prelims and course material + 1-2 MATLAB problems, 3-5 Java problems + closed book + fill-in-the blank, fill-in-the box +-----------------------------------------------------------------------------+ New Java material: Inheritance: + $super.$: access a superclass member (variable, method) + $private$ members "do not inherit" (also known as "inaccessible, but defined") - private members are accessed by the superclass when constructing an object and making a call to a public member that uses a private member + other visibility modifiers: - $protected$: $private$ to an outside class, but $public$ to a subclass - default (blank): $private$ to a class outside the package, but $public$ within the class + $Object$: all classes inherit from $Object$ (there's a question about whether or not interfaces do as well...for now, assume that interfaces are separate thing...) - $toString$, $getClass$, $equals$ methods + $abstract$ classes - have at least 1 abstract method + $interface$ - completely abstract, though may contain variables (usually constants) Polymorphism: + a subclass object may have a superclass reference type + methods accessed from the actual class type of the object (dynamic lookup/binding) + typical use is collecting objects from an inheritance hierarchy in an array +-----------------------------------------------------------------------------+ MATLAB material - the questions will come from E12, the project, and lecture examples - likely you will have 1 program to write in MATLAB (E12, P6) and a 2nd problem with short-answer questions (lecture, lecture notes) Basics: + command windows, edit windows + finding help + everything is an array + file management - ASCII - setting path - loading M-Files Keywords: + loops: $while$, $for$, $end$ + conditions: $if$, $elseif$, $else$, $end$ + scalars - numbers - operators - precedence - associativity + booleans - values: 0 (false), 1 (true) - relations + arrays - sizes and dimensions - 1D - 2D - locations of elements - indicies (single index) - indicies (row,col indicies) - creating - colon - $ones$, $zeros$ - extracting values - inserting values - swapping rows/cols - math - array arithmetic + Loops - repetition - accumulation - conditional update + User-Defined Functions - creating your own functions - function M-files - Variable passing - returning no values - basic recursion (a function calling itself) - subfunctions + Random numbers - generating random numbers - generating random numbers within a given range + mod function - find the remainder + strings - characters as ASCII codes - converting - num2str + Logical Arrays