csc204 – programming i lecture 1 august 23, 2006

26
CSC204 – Programming I Lecture 1 August 23, 2006

Upload: marian-matthews

Post on 04-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSC204 – Programming I Lecture 1 August 23, 2006

CSC204 – Programming I

Lecture 1August 23, 2006

Page 2: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 2

Today’s Topics Syllabus – an introduction to the course Roster – introduce yourself to the class Get started- an intro to programming [next time – an intro to OOP with Java]

Page 3: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 3

About The Course Instructor

Martin Q. Zhao, Ph.D. 201 B Computer Science BuildingPhone: 301-2425Email: [email protected]

Text

Java Program Design 5.0

by Cohoon & Davidson Just Enough UNIX

by Andersen

Page 4: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 4

Course Description Learn how to program in Java Structured & object-oriented programming

basic syntax and semantics simple data types and control structures classes and objects arrays and graphics

Learn how to analysis, design, implement, test and debug programs

Page 5: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 5

Other Elements (for assessment purposes)

Computer Ethics A book will be loaned to you A class session and one lab will be used Test questions in the third mid term and the

final exam AP A test

Used as bonus points (up to 20)

Page 6: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 6

Grade Breakdown 

One hour exams (3 at 100 points each)

300 points

Comprehensive Final exam 200 points

Homework assignments (10 at 10 points each)

100 points

Programming assignments (6 total)

240 points

Lab assignments (14 total) 140 points

Maintain course portfolio 20 points

Total 1000 points

Page 7: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 7

Grading Policy900 or higher A

870-899 B+

800-869 B

770-799 C+

700-769 C

600-699 D

Lower than 600 F

Page 8: CSC204 – Programming I Lecture 1 August 23, 2006

Chapter 1

Getting Started

Page 9: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 9

What is Computer Science? Is computer science the science of

computers? Not exactly. It is the science of information

processes and their interactions with the world. It is the systematic study of algorithmic

processes that describe and transform information: their theory, design, efficiency, implementation, and application.

What is the main concern of computing? What can be (efficiently) automated?

Page 10: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 10

Areas of Computer Science algorithm and data structure programming languages computer architecture operating systems software engineering data and knowledge base systems artificial intelligence and robotics human-computer interface

Page 11: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 11

Automation Starts from Programs What is a program?

How can the instructions defined in a program be executed?

public class AutomatedProcess { public static void main(String[] args) { System.out.println("Step #1"); System.out.println("Step #2"); System.out.println("Step #3"); }}

Page 12: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 12

processor

Computer Architecture – a

simplified view

012345

4194300419430141943024194303

diskkeyboard

display

printer

memory

Page 13: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 13

Number Representation & More Decimal or binary representation?

What does computers use and why? Examples:

4,506 1101

Bit and byte What is the largest number that can be represented

with a byte?

Units of measure Time: ms, ns File size: KB, MB, GB, TB

Page 14: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 14

Software & Hardware Machine

language Assembly

language High-level

language

Page 15: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 15

Additional Background Info

Page 16: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 16

History of Java Java’s predecessor was Oak, a language designed

by James Gosling at Sun Microsystems. Oak was given the more-marketable name “Java”

in January 1995. Java was officially announced in May 1995. The first official release of Java occurred in

February 1996, when Sun made available version 1.0 of the Java Development Kit.

Java 1.2 (released by the end of 98) and higher is referred to as Java 2.

The latest Java version is 1.5, also known as Java 5.

Page 17: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 17

Why Java? Simple Object-oriented Platform independent

“Write once, runs everywhere!”

Built-in security Distributed Interpreted J2SE, J2EE, and J2ME targeted for various

development needs It’s free

Page 18: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 18

Interesting Links about Java General reading

http://java.sun.com/nav/whatis/index.html (A quick guide to the Java technology)http://www.zdnet.com/eweek/stories/general/0,11011,2804967,00.html (Study: Java to overtake C/C++ in 2002)

For those who have programming experience

http://java.sun.com/docs/books/tutorial/

Java API

http://java.sun.com/j2se/1.5/docs/api/

Page 19: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 19

What Do Computers Do? A computer system is an integrated collection

of hardware and software components. Hardware refers to the electronics inside a

computer. Software consists of programs that tell the

hardware what to do.

Page 20: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 20

Types of Computer Systems Some computer systems are embedded within

other objects. These are called embedded systems.

Other computer systems are intended for direct use by humans (users).

Some systems support multiple simultaneous users, while others are limited to one user at a time.

Systems in the latter category are usually called personal computers, although high-end single-user systems are often called workstations.

Page 21: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 21

Hardware Processors

Central processing unit, or CPU Specialized processors, such as a graphics processor

Memory Main memory, or RAM (random-access memory) ROM (read-only memory) Hard disks, floppy disks, and other storage media

Peripheral devices Provide an interface to the world outside the system Include keyboards, mice, monitors, printers, and

modems

Page 22: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 22

Software Software consists of programs that instruct the

hardware how to perform operations. A program is a step-by-step set of instructions. Categories of software:

Operating systems. A collection of programs that interact directly with the computer’s hardware.

Applications. Programs designed to perform useful tasks for humans.

We are writing this kind of programs. An operating system serves as a bridge between

hardware and applications.

Page 23: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 23

Platforms The combination of an operating system and a

particular type of CPU is often called a platform. Software usually works only on a single platform. Java programs, however, will run on multiple

platforms without change. This is usually referred to as good portability.

Most of the time, a computer system has only one operating system but many applications.

Applications are usually designed for one particular version of an operating system.

Page 24: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 24

File Systems A file is a collection of related data. In many operating systems, a file name

includes an extension that indicates the type of data stored in the file.

Common Windows file extensions:.exe (executable program) .doc (document).gif, .jpg (image)

Page 25: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 25

File Operations Basic file operations:

Create, Edit, Copy, Rename, Delete A file can be created or edited by using an

editor or word processor. An editor is a program that can create or

modify a file containing text (ordinary characters).

A word processor has the added ability to format text. It is usually not used in our class, except you want

to make your homework more impressive.

Page 26: CSC204 – Programming I Lecture 1 August 23, 2006

8/23/2006 CSC 204 Programming I 26

Directories A directory is a place where files can be

kept. Directories are also known as folders.

Directories are normally organized in a tree-like fashion.

Basic directory operations: Create a directory Move from one directory to another List the files in a directory