Docsity

Midterm Overview - Object-Oriented Programming II | CMSC 132, Exams of Computer Science

Partial preview of the text

Download Midterm Overview - Object-Oriented Programming II | CMSC 132 and more Exams Computer Science in PDF only on Docsity!

Midterm 1 Overview

Fawzi Emad

Chau-Wen Tseng

Department of Computer Science

University of Maryland, College Park

Overview of Topics

1. Software development & software life cycle

2. Object-oriented design

3. Unified Modeling Language (UML)

4. Networking

5. Algorithmic complexity

Software Life Cycle

Phases of cycle

Specification ⇒ … ⇒ maintenance Waterfall model

Program design methods

Top down Object oriented

Testing

Verification Empirical Unit, integration, acceptance tests Code coverage

Object-Oriented Design

Objects & classes

Motivation State, behavior, identity Inheritance

Finding classes

Nouns in problem specification

Finding methods

Verbs in problem specification

Algorithmic Complexity

Benchmarking vs. analysis

Asymptotic analysis

Big-O notation Average & worst case Comparing complexity

Finding critical sections

Finding code Evaluating complexity

Recursive algorithms

Midterm Question Formats

Multiple choice questions

Short 1-sentence answers

Design classes (from specification)

Analyze UML class diagrams

Draw UML class diagrams (from code)

Analyze complexity of code fragments

Multiple Choice Question Example

Using Object-Oriented design, we view a

problem as a collection of

Objects Functions None of the above

We find objects in the problem specification by

looking for

Nouns Verbs All of the above

Short 1-Sentence Answer Example

What is an IP address?

A unique 64-bit number for each computer connected to the internet using the Internet Protocol (IP)

How do you get an IP address for your

computer?

Your IP address is assigned by a server at your service provider when you connect to the internet

Draw UML Example

Draw UML class diagram for following code

class foo { go() { class bar b; } } class bar { class foo f; } class test extends foo { }

Analyze Complexity Example

What is the complexity of the following codes?

for (i = 1; i < n; i++) { for (j = 1; j < 2n; j++) … } } for (i = 1; i < n; i=i4) { for (j = 1; j < 100; j++) … } }