compsci 105 ss 2005 principles of computer science lecture 4 lecturer: santokh singh

Post on 12-Jan-2016

220 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

CompSci 105 SS 2005

Principles of Computer Science

Lecture 4

Lecturer: Santokh Singh

Parity

Abstraction

Modular Design

Procedural Abstraction

Data Abstraction

Abstract Data Types

Information Hiding

Software Life Cycle

Basic Stages

Specification and Design

Verification via Loop Invariants

Costs Associated with Software

Hacking

• Type in a heap of code

Hacking

• Type in a heap of code

• Battle compilation errors

Hacking

• Type in a heap of code

• Battle compilation errors

• Run the code

Hacking

• Type in a heap of code

• Battle compilation errors

• Run the code

• If doesn’t work, change a random thing

Software Engineering

• Large Projects

• Team Development

• Guaranteed Results

• Easy Modification

Abstractions

ComplexObject

IdealisedModel

IgnoreInessential

Details

Class Reps

Name login

First meeting today/tomorrow (..) ..time

Place (CompSci …)

Parity

Abstraction

Modular Design

Procedural Abstraction

Data Abstraction

Abstract Data Types

Information Hiding

Software Life Cycle

Basic Stages

Specification and Design

Verification via Loop Invariants

Costs Associated with Software

Modular (Class) Design

System

SecretCodes

String

Random

Procedural (Method) Design

Encode

SecretCodes

Main

Decode

Information Hiding

Program that uses the String

Class

Implementation of the

String Class

API for the

String Class

Data Abstraction

int x = 14;

1110

14

Software Life Cycle

Specification

Design

Verify

Code

Test

Refine

Produce

Maintain

Software Life Cycle

Specification

Design

Verify

Code

Test

Refine

Produce

Maintain

Agreeing on a method

• Suppose we want a method that adds two integers

uses the add method

implements the add method

What needs to be specified?

• Suppose we want a method that adds two integers

public int add ( int x, int y )

What needs to be specified?

• Suppose we want a method that adds two integers

// General Description:// Precondition: // Postcondition: public int add ( int x, int y )

Course Book

We have been referring to the Course Book during lectures:-

• Pages 62 - 64: Numbers in the Computer

• Pages 65 - 92: Data Representations

Please attend ALL classes for better understanding & for your own good.

top related