Docsity

CMSC 131 Spring 2009: Object-Oriented Programming I Course Overview - Prof. Bonnie J. Dorr, Lab Reports of Computer Science

Toggle sidebar
bg1
1
CMSC 131 Spring 2009
Jan Plane (adapted from Bonnie Dorr)
CMSC131
Lecture Set 1:
Introduction
Topics in this set:
1. Course information
2. Tools needed for this course
3. Computer terminology basics
1CMSC 131 Spring 2009
Jan Plane (adapted from Bonnie Dorr)
CMSC 131
Name: “Object-Oriented Programming I”
Instructor: Jan Plane
TAs: Anusha, Shravya, Ferhan, Angela, Neha,
Latha, Sam & Hyoungtae
Class meetings
Lecture sections
3 lecture sections
Lab sections
7 lab sections
8 teaching assistants
Office Hours
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download CMSC 131 Spring 2009: Object-Oriented Programming I Course Overview - Prof. Bonnie J. Dorr and more Lab Reports Computer Science in PDF only on Docsity!

CMSC 131 Spring 2009 Jan Plane (adapted from Bonnie Dorr)

CMSC

Lecture Set 1:

Introduction

Topics in this set:

1. Course information

2. Tools needed for this course

3. Computer terminology basics

CMSC 131 Spring 2009 1 Jan Plane (adapted from Bonnie Dorr)

CMSC 131

 Name: “Object-Oriented Programming I”

 Instructor: Jan Plane

 TAs: Anusha, Shravya, Ferhan, Angela, Neha,

Latha, Sam & Hyoungtae

 Class meetings

 Lecture sections

 3 lecture sections

 Lab sections

 7 lab sections

 8 teaching assistants

 Office Hours

CMSC 131 Spring 2009 2 Jan Plane (adapted from Bonnie Dorr)

What Is This Course?

 A fast-paced introduction to techniques for writing computer programs!

 Skill Development in Programming

 Conceptual Understanding of Programming

 Not really “computer science”

 There will be quite a bit of work but assumes you are starting at level 0.

 Keys to success

 Attend all classes and lab sections

 Start assignments early – and continue until you truly understand

 Get help early if you are having trouble – instructor & TAs

 Study every day

 it doesn’t work to cram for these exams  ask questions as soon as you realize you are confused

 Check announcements on course web-page every day

CMSC 131 Spring 2009 3 Jan Plane (adapted from Bonnie Dorr)

Textbooks & Course Web-Page

 http://www.cs.umd.edu/class/spring2009/cmsc131/

 Check daily!

 Review:

 Announcements

 Syllabus

 Contact

 Schedule

 Lecture slides – outlines

 Study questions – login: study password: daily

CMSC 131 Spring 2009 6 Jan Plane (adapted from Bonnie Dorr)

Basics of Eclipse

 http://www.cs.umd.edu/eclipse/EclipseTutorial/

 Eclipse is used to:

 Create

 Edit

 Compile

 Run

 Debug

programs (for this class, Java programs).

CMSC 131 Spring 2009 7 Jan Plane (adapted from Bonnie Dorr)

Basics of Eclipse-speak

 Project : collection of related source files

 To create a program in Eclipse:

 Create a new project  Create files in the project

 Perspective : framework for viewing and/or manipulating programs

 Important perspectives in this class:

 Java : for creating, running programs  Debug: for tracing, removing errors in programs  CVS repository : for interacting with assignment-submission system

 Workspace: Where your files are stored locally

 Buffer: Window where editing takes place

 Demo

CMSC 131 Spring 2009 8 Jan Plane (adapted from Bonnie Dorr)

Class Projects with CVS

 You will use Eclipse for Java programming in this

course

 How will you:

 obtain (check-out) files that are supplied to you

 save (commit) the files for later work

 turn in (submit) when you are finished

 CVS (= Concurrent Versions System)

 Tool for project-file management

 Maintains versions, etc.

 Allows different sites to work on same project

CMSC 131 Spring 2009 9 Jan Plane (adapted from Bonnie Dorr)

CVS Worldview

Files in “repository”

Server

Files (local copies)

Client 1

Files (local copies)

Client 2

“checkout”

“checkout”

“commit”

“commit”

Demo

  1. Making a new Repository Location

  2. Checking Out a project

  3. Making changes to that project

  4. Committing the project

  5. Program execution

  6. Submitting the project

  7. Looking at the runtime results

CMSC 131 Spring 2009 12 Jan Plane (adapted from Bonnie Dorr)

CMSC 131 Spring 2009 13 Jan Plane (adapted from Bonnie Dorr)

Adding a CVS Repository

Common to everyone

Your linuxlab username

Your linuxlab password

Don’t forget to set this!

CMSC 131 Spring 2009 14 Jan Plane (adapted from Bonnie Dorr)

Working on Project

 You do not have this project showing in the Java

perspective.

 You go to the CVS perspective and check it out.

 When you switch back to “Java” perspective,

your project is now there!

 Make sure you are in the Java perspective to

edit

 When you save in “Java” perspective, changes

are automatically committed to CVS repository.

CMSC 131 Spring 2009 15 Jan Plane (adapted from Bonnie Dorr)

Submitting the Project

 Edit the file

 Make sure it runs correctly

 Submit the project for grading

 Go to submit.cs.umd.edu to see test results

 Public tests

 Private tests

 Release tests

 give limited feedback (first two failed tests give more)

 costs you “tokens” – usually 3 to start with

 spent tokens regenerate in 24 hours

CMSC 131 Spring 2009 18 Jan Plane (adapted from Bonnie Dorr)

Main Memory

 Computer data consists of

off and on pieces (often

written as 0’s and 1’s)

 bit: A single cell in main

memory that can hold either

a 0 or 1

 byte : A sequence of 8 bits

 word: Unit of memory (often

a sequence of 4 bytes)

 Main memory: table of

bytes indexed by

“addresses”

Address Byte value

1

2

3

4

1 0 0 1 1 1 0 1

0 0 0 1 1 0 0 1

1 1 1 1 1 1 0 1

1 1 0 0 0 1 0 0

CMSC 131 Spring 2009 19 Jan Plane (adapted from Bonnie Dorr)

How Many Different Values in

a…

 Bit?

2

 Two bits?

4 = 2 x 2

 Byte?

256 = 2 x 2 x 2 x 2 x 2 x 2 x 2 x 2 = 2^8

 Word?

4,294,967,296 = 2^32

CMSC 131 Spring 2009 20 Jan Plane (adapted from Bonnie Dorr)

Other Standard Terminology

 1 KB = 1 “kilobyte” = 2^10 bytes = 1,024 bytes

 1 MB = 1 “megabyte” = 2^10 KB = 1,024 KB

 1 GB = 1 “gigabyte” = 2^10 MB = 1,024 MB

CMSC 131 Spring 2009 21 Jan Plane (adapted from Bonnie Dorr)

How Are Characters, Etc.,

Represented?

Via encoding schemes

Example: ASCII (American Standard Code for

Information Interchange)

 Standard for encoding character values as bytes

 In ASCII:

 ‘A’ 01000001

 ‘a’ 01100001

 etc.

There are other character encoding schemes also:

Shift-JIS, Unicode, etc.

CMSC 131 Spring 2009 24 Jan Plane (adapted from Bonnie Dorr)

Programming Languages

 Used to write programs that run on

computers

 Generations of programming languages

 1 st^ (1GL): machine code

 2 nd^ (2GL): assembly code

 3 rd^ (3GL): procedural languages

 4 th^ (4GL): application-specific languages

 5 th^ (5GL): constraint languages

CMSC 131 Spring 2009 25 Jan Plane (adapted from Bonnie Dorr)

1

st Generation: Machine Code

 Recall: computer data is 0’s and 1’s.

 In machine code, so are programs!

 Program: sequence of instructions

 Machine code: instructions consist of 0’s and 1’s

 Next slide: example machine code instruction from

MIPS (= “Microprocessor without interlocked pipeline stages”) architecture

 Popular in mid-, late 90s

 Instructions are 4 bytes long

CMSC 131 Spring 2009 26 Jan Plane (adapted from Bonnie Dorr)

Example MIPS Instruction

 “Add data in addresses 1, 2, store result in

address 6”:

00000000001000100011000000100000

 ???

000000 00001 00010 00110 00000 100000

opcode

1 st^ address

2 nd^ address

destination address

shift amount

function specifier

CMSC 131 Spring 2009 27 Jan Plane (adapted from Bonnie Dorr)

Programming in 1GLs

Courtesy of Microsoft Encarta Encyclopedia Online. Copyright (c) Microsoft Encarta Online

CMSC 131 Spring 2009 30 Jan Plane (adapted from Bonnie Dorr)

3

rd Generation: Procedural

Languages

 Problems with 2GLs

 Platform dependency

 Different kinds ( architectures ) of computers use different

instruction formats

E.g. x86, Pentium, 68K, MIPS, SPARC, etc.

 1GL / 2GL programs written for one kind of machine will not

work on another

 Low level : programs difficult to understand

 Solution (60s -- now): procedural languages

 Higher-level, “universal” constructs

 Examples: Cobol, Fortran, Algol, Pascal, C, C++, Java, C#

CMSC 131 Spring 2009 31 Jan Plane (adapted from Bonnie Dorr)

Compilers

 Computers can only execute machine code

 Compilers are programs for translating 3GL

programs (“source code”) into assembler / machine code

source (^) compiler asm

CMSC 131 Spring 2009 32 Jan Plane (adapted from Bonnie Dorr)

Interpreters

 Another way to execute 3GL programs

 Interpreters take source code as input

 Interpreters execute source directly

 Much slower than compiled programs

 Debuggers are based on interpreters

 Debuggers support step-by-step execution of source code

 Internal behavior of program can be closely inspected

CMSC 131 Spring 2009 33 Jan Plane (adapted from Bonnie Dorr)

Object Oriented Terminology

 Procedural Languages

 have procedures that can be reused

 Object Oriented Languages

 centered on the objects

 object

 principal entities that are manipulated by the program (nouns)

 class

 a “blueprint” that defines the structure for one or more objects

 method

 java term for a “function”, a “procedure” or a “subroutine”

 this is the code that does something (verbs)

 main method

 a special method that defines where program execution begins

 statements

 individual instructions