Review sheet for Final Exam (List of objectives for this course)

Similar documents
Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.

Basic Principles of OO. Example: Ice/Water Dispenser. Systems Thinking. Interfaces: Describing Behavior. People's Roles wrt Systems

CMSC 132: Object-Oriented Programming II

Introduction to Programming Using Java (98-388)

COP 3330 Final Exam Review

CMSC 132: Object-Oriented Programming II

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012

WA1278 Introduction to Java Using Eclipse

CS Exam 1 Review Suggestions

Cpt S 122 Data Structures. Course Review FINAL. Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

CMSC131. Inheritance. Object. When we talked about Object, I mentioned that all Java classes are "built" on top of that.

Objective Questions. BCA Part III Paper XIX (Java Programming) page 1 of 5

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Chapter 6 Introduction to Defining Classes

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014

Building custom components IAT351

Midterm assessment - MAKEUP Fall 2010

RAIK 183H Examination 2 Solution. November 10, 2014

CONTENTS. Chapter 1 Getting Started with Java SE 6 1. Chapter 2 Exploring Variables, Data Types, Operators and Arrays 13

Data Structures (list, dictionary, tuples, sets, strings)

Reviewing for the Midterm Covers chapters 1 to 5, 7 to 9. Instructor: Scott Kristjanson CMPT 125/125 SFU Burnaby, Fall 2013

Java Programming Lecture 7

Chapter 4 Defining Classes I

Compaq Interview Questions And Answers

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Short Notes of CS201

Absolute C++ Walter Savitch

CS201 - Introduction to Programming Glossary By

Casting -Allows a narrowing assignment by asking the Java compiler to "trust us"

CSE 70 Final Exam Fall 2009

Chapter 10 Classes Continued. Fundamentals of Java

+ Abstract Data Types

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries

Week. Lecture Topic day (including assignment/test) 1 st 1 st Introduction to Module 1 st. Practical

VALLIAMMAI ENGINEERING COLLEGE

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

Agenda CS121/IS223. Reminder. Object Declaration, Creation, Assignment. What is Going On? Variables in Java

CS506 Web Programming and Development Solved Subjective Questions With Reference For Final Term Lecture No 1

CGS 2405 Advanced Programming with C++ Course Justification

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented

Prelim 1 SOLUTION. CS 2110, September 29, 2016, 7:30 PM Total Question Name Loop invariants. Recursion OO Short answer

OBJECT ORİENTATİON ENCAPSULATİON

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism

CS121/IS223. Object Reference Variables. Dr Olly Gotel

+! Today. Lecture 3: ArrayList & Standard Java Graphics 1/26/14! n Reading. n Objectives. n Reminders. n Standard Java Graphics (on course webpage)

Table of Contents. Chapter 1 Getting Started with Java SE 7 1. Chapter 2 Exploring Class Members in Java 15. iii. Introduction of Java SE 7...

Java Programming Training for Experienced Programmers (5 Days)

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

CompuScholar, Inc. 9th - 12th grades

Object-Oriented Programming

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

CS 180 Final Exam Review 12/(11, 12)/08

CS260 Intro to Java & Android 03.Java Language Basics

CS 231 Data Structures and Algorithms, Fall 2016

Interactive Programming In Java

PROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7

CS-202 Introduction to Object Oriented Programming

Programming II (CS300)

Chapter 13 Object Oriented Programming. Copyright 2006 The McGraw-Hill Companies, Inc.

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR (ODD SEM)

Overview of OOP. Dr. Zhang COSC 1436 Summer, /18/2017

Java: introduction to object-oriented features

More on Objects in JAVA TM

CS/ENGRD 2110 SPRING Lecture 2: Objects and classes in Java

CS/ENGRD 2110 FALL Lecture 2: Objects and classes in Java

Atelier Java - J1. Marwan Burelle. EPITA Première Année Cycle Ingénieur.

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

The JFrame Class Frame Windows GRAPHICAL USER INTERFACES. Five steps to displaying a frame: 1) Construct an object of the JFrame class

VALLIAMMAI ENGINEERING COLLEGE

Object Orientated Analysis and Design. Benjamin Kenwright

1 Epic Test Review 2 Epic Test Review 3 Epic Test Review 4. Epic Test Review 5 Epic Test Review 6 Epic Test Review 7 Epic Test Review 8

Objects First with Java

Computer Science II (20073) Week 1: Review and Inheritance

Java Programming Lecture 6

104. Intermediate Java Programming

Mathematics/Science Department Kirkwood Community College. Course Syllabus. Computer Science CSC142 1/10

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Summer Final Exam Review Session August 5, 2009

Argument Passing All primitive data types (int etc.) are passed by value and all reference types (arrays, strings, objects) are used through refs.

CS112 Lecture: Defining Instantiable Classes

Get Unique study materials from

Assoc. Prof. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Java Object Oriented Design. CSC207 Fall 2014

Fast Track to Core Java 8 Programming for OO Developers (TT2101-J8) Day(s): 3. Course Code: GK1965. Overview

About this exam review

Why Design by Contract! CS 619 Introduction to OO Design and Development. Design by Contract. Fall 2012

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Final Exam. Final Exam Review. Ch 1: Introduction: Object-oriented analysis, design, implementation. Exam Format

TeenCoder : Java Programming (ISBN )

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

Software Development & Education Center. Java Platform, Standard Edition 7 (JSE 7)

Project 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently.

RAIK 183H Examination 2 Solution. November 11, 2013

Inheritance and Polymorphism

Inheritance. Transitivity

Software Architecture (Lesson 2) Object-Oriented Paradigm (1)

Transcription:

Review sheet for Final Exam (List of objectives for this course) Please be sure to see other review sheets for this semester Please be sure to review tests from this semester Week 1 Introduction Chapter 1 1. Describe steps of software lifecycle and what each step involves 2. Distinguish between top-down and object-oriented design 3. Understand pre- and post-conditions 4. Understand difference between formal verification and empirical testing 5. Distinguish between methodology vs. ad hoc programming methods You must know: 1. Software life cycle a. Problem spec i. statement of exact problem to be solved problems people completeness and language b. Program design i. Specification of an integrated set of components 1. components have: a. preconditions b. postconditions c. interface Approaches to design 1. top-down emphasis on what is being done break down problem by function 2. OO design who is doing something rather than what is being done, decompose along lines of entities in program, leads to classes c. Selection of algorithms and data structures i. array, list, vector, collections, trees, etc. d. Coding and debugging i. How can we increase productivity reuse code and libraryies Use modern language features (and APIs) such as exceptions, inheritance, streams and event-based programming. e. Testing and verification CS201 Course Page 1 of 10 5/6/2005

i. Verification (*formal methods*) very expensive Testing 1. unit tests - junit 2. integration tests junit but bigger chunks, not just methods inside one object but across larger collections or entities 3. acceptance tests written by customer f. Documentation and support i. User manual for the customer Technical documents for the maintainer g. Maintenance i. Deals with issues of correctness (corrective 20%) Deals with changing equipment (adaptive 20%) i Changing business requirements (perfective 60^) iv. Expense 1. good software is maintained (bad software dies and does not cost much to maintain) v. maintenance matters and costs even if released code has zero defects. 2. Cost of phases of software lifecycle a. Problem spec - 7% b. Program design 6% c. Selection of algorithms and data structures d. Coding and debugging 5% e. Testing and verification 7% i. Integration 8% f. Documentation and support and Maintenance 67% Week 2 Chapter 2 1. Understand conceptual underpinnings of OO programming a. Class, object, inheritance, association, dependency 2. Understand terminology of OO programming 3. Explain and use different types of inheritance 4. Pick out terms used in spec. document and determine classes and methods 5. Draw simple UML class diagrams You must know/be able to: a. Define objects i. State 1. properties behavior 1. how it reacts 2. change in state 3. interaction with other objects i identity 1. a way of distinguishing one object from another CS201 Course Page 2 of 10 5/6/2005

2. reference variables used to do this iv. encapsulation 1. Hide the inner workings v. Grouped into sets called classes b. Know equivalence i. Name equivalence (reference variables for the same object on the heap) Content equivalence ( deep, structural property based on state of objects) c. Classes group of objects that share common state and behavior i. Class is a blueprint Object is instance of blueprint d. Inheritance i. State and behavior of one class are subset of another more general class More general class is superclass i Other class is more specialized instance of superclass iv. Is-A relationship holds v. Has-a relationship comes when one class component of another 1. think instance fields e. Types of inheritance i. Specification 1. like an interface interface specifies all the behavior but none of the implementation 2. implementing interfaces fits here Specialization 1. is-a relationship when we re-implement behaviors that exist in the superclass 2. extending abstract classes fit here 3. extending other classes without adding new methods belongs here i Extension 1. when we add new behaviors not present in the superclass iv. Limitation 1. new (inherited) class will prevent calling methods 2. strictly speaking, limited methods are re-implemented as nooperations v. combination 1. inheriting from 2 or more superclasses a. java limits this to extending one class or abstract class but implementing multiple interfaces f. OO design i. Requirements phase 1. User s need (like user stories) 2. desired effects to be produced by software Specification phase 1. behavior of program a. outputs b. hardware environment c. how to produce the effects desired CS201 Course Page 3 of 10 5/6/2005

i design phase 1. identify classes, behaviors and interactions of classes a. nouns i. classes or components of classes b. verbs methods g. UML class diagrams i. Name, state, behavior, associations Week 3 1. Learn about software quality through inspections and reviews 2. Understand the class design process You must know/be able to: 1. difference between walk-through and inspection a. walk-through i. prep by bringing lists of items visually inspect code for about 2 hours i detect, don t corect iv. document-driven (lists) v. verbalize the code helps find faults b. Fagan inspections i. Overview Preparation i Inspection iv. Rework v. Follow-up vi. Roles 1. moderator, reader, author, inspector, specialists,recorder 2. Things to look for in inspections and reviews a. Logic b. Adherence to requirements c. Formatting: i. Meaningful variable and method names Consistent formatting (tabs, brackets) i Capitalization of class names and lowerupper (camel) format for method/variable names, CONST-VAL format for constants iv. Comments for classes, all methods, global variables d. Use of public, protected, private, static, final as appropriate e. Meaningful, small methods 3. OO design process a. Looking for nouns i. State Behavior i Interactions or relationship CS201 Course Page 4 of 10 5/6/2005

Week 4 1. Understand how java and JVM run your program 2. Reason about behavior of Java programs based on Heap and stack model of data 3. Reason about behavior of Java programs based on visibility rules 4. Understand reference variables/primitive variables 5. Understand arrays in Java You should know: 1. what happens when you run a program a. java MyClass i. jvm loads a bunch of classes and initializes the environment jvm loads your classes i looks for method main in your classes iv. main creates objects and we are off to the races b. static methods and data exist in code areabefore an object is created c. Objects are created on the heap i. Live on heap until no reference point to them d. Local variables (belonging to methods) and parameters live on stack i. Live on stack until the method finishes up or returns e. Reference variables don t create objects, you must use new and constructor to do so i. New objects live on heap May have multiple reference variables referring to object on heap i When no more reference variables refer to object on heap it may be garbage collected (returned for later use) f. Primitive variables value is held in the variable g. Reference variables reference to object is held in the variable h. Parameters passed by value (i.e., we copy them on the stack) i. Understand why we cannot write a swapper function with primitive variables 2. Visibility rules a. Public if something is public, then any code can see it/ use it and compiler will allow this b. Private if something is declared private, then only code in the same class can see this we might have called this class visibility. Subclasses cannot see these items. c. Protected if something is declared protected, then this class and all of its subclasses can see the item/method d. Package if something is not declared with a visibility, then by default the item or method has package visibility kind of like public but only for other things in the same package 3. misc a. Final write once to a variable either in declaration or once in the code CS201 Course Page 5 of 10 5/6/2005

b. Constructors get them by default, but once we define a constructor for a class we lose the old default constructor. 4. what happens on instantiation (i.e., when new keyword with constructor is used) a. memory allocated on heap b. default initialization occurs - reference variables are initialized to null, integers to 0, doubles to 0, etc. c. constructor is invoked 5. Arrays a. Declaration i. // int [] intarray; - just declares a reference variable NOT an array // int [] intarray = new int[55]; - declares a reference and creates an aray of int s i // int [] intarray = {1,2,3,4,5}; - declares a reference and creates an array of 5 ints and initializes them to 1,2,3,4 and 5 respectively b. Where do these things live? c. Given code, show where parts live (heap/stack/etc.) d. You should understand why the swap method from lab cannot be written e. You should understand why you might want a private constructor f. You should be able to write a good unit test for a methods that return primitives and reference variables Week 5 1. Understand a deep copy 2. Understand Java-based inheritance 3. Understand event-based programming and Java-based GUIs and their heavy use of interfaces You must know: 1. why inheritance is valuable polymorphism 2. definition of polymorphism a. means many forms b. objects with different forms, same behaviors c. substitution principle we use subclasses anywhere superclass is used 3. Inheritance a. Interfaces implements keyword b. Abstract classes c. Classes extends keyword d. Constructors i. Default version calls super() We can override CS201 Course Page 6 of 10 5/6/2005

i You should understand the order in which default constructors call super() 4. Overriding versus overloading a. Override inherit an implementation of a method and we rewrite the method to get new behavior i. We get tostring() for free, but usually we rewrite it to get nicer output b. Overload have an existing form of a method and we rewrite the method with new parameter types i. + operator can add integers and concatenate Strings Don t have to use inheritance to do this we can overload a method in a single class 5. Interfaces and Abstract classes a. How to declare each b. How to inherit based on them c. Type of inheritance each implies 6. GUIs and Event based programming a. GUIs visual tool for interacting with user b. Widget graphical components like buttons, etc c. Event object that represents user action on a widget d. Listener object whose job is to wait for event i. Interfaces often used to specify event listeners classes 7. GUI specifics a. JFrame i. Constructor Setting default close i setsize() and setvisible() methods iv. contentpane() getting and adding objects b. JLabel constructor and setting text c. JButton constructor and setting text d. JTextField constructor, setting and getting text e. Layout Manager 8. Event handling a. ActionListeners are interfaces, not classes b. Must define actionperformed(actionevent e) c. Must addactionlistener to register listener with Widget Week 7 1. Exceptions (also see later weeks and look at chapter 10 ) 2. See a bigger example of OO design from start to finish 3. Understand how to go from problem requirements (user defined) to program specification (how program will do it) to design (id of classes ) to use of inheritance and use of UML DO NOT WASTE TIME MEMORIZING CLASSES OR METHODS FROM THIS CHAPTER CS201 Course Page 7 of 10 5/6/2005

You must: 1. understand role of exceptions a. without exceptions, code must look for unusual events or risk missing them b. with exceptions in languages, exceptions are types or classes used to describe unusual events i. exception object created to describe event exception handler analyzes the exception event and takes appropriate action 2. Understand exceptions are instantiated (i.e., have constructors) 3. Understand syntax of try-catch block a. parameter to catch block is type of exception object b. May have several catch blocks for one try block c. You have to either handle or rethrow 4. Understand the throws keyword a. If exception not handled in your method, the calling method will need to handle an exception Weeks 8 and 9 : 1. understand reference-based structures linked lists and stacks You must know this about linked lists: 1. understand list structure can grow as large as needed (unlike arrays) 2. understand behaviors a. add, remove, add/remove to/from certain positions, append to end, get and set values already on list 3. Understand basic recursive class definition ( object, reference to next node) 4. Understand behavior of methods (from text and labs) 5. Understand how linked list is represented in stack and heap You must know this about stacks: 1. understand push, pop, top, isempty and height 2. understand behavior of stack (namely, first on the stack, last off the stack) While queues are just a simple extension of linked lists and were not covered explicitly in class, you might want to look at Queues in the text: 1. we saw an example of a queue in exam 3 2. we wrote code for a queue in lab exam 3. understand they are like check-out lines in a grocery store CS201 Course Page 8 of 10 5/6/2005

Week 10 : 1. Understand recursion 2. Understand risks of developing software You must be able to/ know about 1. Examples of Risks a. Schedule slippage b. Project is cancelled c. System goes bad d. Defect rate so high, never used e. Business misunderstood f. Business changes g. False feature rich 2. Examples of how to handle risks a. Develop in small iterations with short deadlines, i.e.: i. Get user stories break into tasks i estimate time iv. get customer to prioritize 1. avoid false feature rich 2. if they don t want to pay for it don t do it (yet) v. get acceptance test (so you know when you are done) vi. v sign up for wanted tasks pair program 1. instant code reviewer on hand vi test first, write unit tests this can serve as some of your technical documentation ix. use revision control (CVS) to keep coders from stomping on one another x. Keep only working (compiling and running) code in CVS xi. Show working code (that passes acceptance test) to client x Rinse and repeat 3. Recursion a. How does it work base case and forward progress (break problem into smaller instance) b. Understand factorial c. Show you can trace through the execution of a recursive program i. Examples are factorial, reverse, addition, multiplication, exponentiation Other examples are based on linked-lists and trees Weeks 11-14 : 1. understand binary trees and how they are structured You must know/understand how to: CS201 Course Page 9 of 10 5/6/2005

1. know terminology from previous review sheet on trees 2. build a binary tree 3. build a binary search tree 4. add and remove items from binary- and binary search trees 5. traverse binary trees inorder, preorder, postorder CS201 Course Page 10 of 10 5/6/2005