computer science 1 lecture 1: administrative details and professor: evan korth new york university 1

25
Computer Science 1 Computer Science 1 Lecture 1: Lecture 1: administrative details and administrative details and Professor: Evan Korth Professor: Evan Korth New York University New York University 1

Upload: julian-jacobs

Post on 05-Jan-2016

221 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

Computer Science 1Computer Science 1Lecture 1: Lecture 1:

administrative details and administrative details and

Professor: Evan KorthProfessor: Evan KorthNew York UniversityNew York University

1

Page 2: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

Road Map for TodayRoad Map for TodayWelcome to Introduction to Computer

Science I!Course Description

– What material will we cover?– What am I getting myself into?

Administrative Issues– Course Web Page, Text Book, Exams, Office

Hours, Homework, Grading, Cheating Policy, etc.

SyllabusReading: chapter 1

2

Page 3: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

Course PrerequisitesCourse Prerequisites Prerequisite: V22.0002 or departmental

permission. Math placement at Calculus I level or higher.

Who should be taking this course:– computer science majors or minors– other science students– students who know the basics of some programming

language. Who should NOT be taking this course

– Students that know Java well (should either go straight to 102 or take the honors section – See me)

You must get a c or better in this class to take further computer science classes.

3

Page 4: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

Course DescriptionCourse Description

Official Description: Students learn how to design algorithms to solve problems and how to translate these algorithms into working computer programs. Experience is acquired through programming projects in a high level programming language. V22.0101 is intended as a first course for computer science majors, and for students of other scientific disciplines.

4

Page 5: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

What the class is really aboutWhat the class is really about

There are three main goals of this course:

1. Foundations of Java2. Foundations Algorithm development3. Foundations of Software Development

5

Page 6: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

1. Foundations of Java 1. Foundations of Java ProgrammingProgramming Java is a popular programming language, widely used in industry. We will learn all the specifics of how to program in Java. This includes all the peculiar rules that are specific to Java. We will review the fundamentals: Variables, Arithmetic, If / Else, For Loops, While Loops, Arrays, Methods, etc.We will cover object orientated material

6

Page 7: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

7

2. Algorithm development2. Algorithm development

We will look at problem solving methods that involve analyzing the problem and designing an algorithm before we start to write code.

Page 8: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

Learn the Principles of Software Learn the Principles of Software DevelopmentDevelopment Building high quality software is very difficult. The course presents the syntax and concepts of

programming, and also presents strategies for building real software that addresses real problems.

I will also try to bring my real-world industry experience to class.

8

Page 9: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

Administrative MattersAdministrative Matters

9

Page 10: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

Course Web SiteCourse Web Site

Course web site is available at: http://cs.nyu.edu/courses/fall03/V22.0101-004/

index.htm Web site contains the following information:

– Administrative information– Course Syllabus– Homework assignments– Class notes– Class programs– Sample exams– Compiler instructions– Link to the class mailing list

10

Page 11: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

Class mailing listClass mailing list

First assignment is to join it. Do it today! Go to:http://www.cs.nyu.edu/mailman/listinfo/

v22_0101_004_fa03 and follow the instructions All assignments and news will be sent to the

class list Homework questions should be sent to the list

and answered by students when possible.

11

Page 12: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

Course Text BookCourse Text Book Introduction to Java

Programming (4th Edition)

Available at the NYU Bookstore

Book includes a CD-ROM with Java programs and other supplemental materials.

Lecture notes will follow the book.

Please keep up with the reading!

12

Page 13: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

SoftwareSoftware For the course, we will be using the following

software:– Sun’s JDK (Java Development Kit) – The Jcreator IDE (Integrated Development

Environment) Both products can be downloaded from the web

for free. The class website has instructions on

downloading and installing these programs. Please download the compiler as soon as possible.

If you do not have your own computer, the computer labs on campus have the software.

13

Page 14: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

GradingGrading

Your grade will be determined as follows:– Midterm (30%)– Homework (possible quizzes) (30%)– Final Exam (40%)

Class participation will help your grade!

14

Page 15: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

homeworkhomeworkIf you do not do the homework programs, you cannot pass the course.

If home work is late, 1 point (25%) is deducted.

After one week of lateness, home work will not be accepted.

Style counts from the beginning of this class.

Submit the program via email to the e-tutor (more on this later)

Back-up your files: For you own good you must save all programs on a disk and back them up on another disk. Computer crashes or lost programs are not valid excuses for not handing in an assignment.

15

Page 16: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

A Word About CheatingA Word About Cheating

For the purposes of this class, cheating is defined as: – Copying all or part of another student's

homework, project or exam. – Allowing another student to copy all or part

of your homework, project, or exam. – Discussing homework concepts is fine, but

you must submit your own work. If you are caught cheating, you will receive an

immediate FAILURE for the course.16

Page 17: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

Student CivilityStudent Civility

In an effort to make this class enjoyable for everybody…– Please be on time to class!– Please do not talk to your friends and

neighbors in class! It disturbs everyone, and makes it hard to concentrate. If you have a question, just ask me!

– Please turn your pagers and cell-phones off! – Please do not sit in the back row.

17

Page 18: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

Getting HelpGetting Help Help is always available! Option 1: Come to my Office Hours

– Tuesdays, 11:00 am – 1:00 pm and Wednesdays, 5:00 – 6:00 pm (I may change the time of my office hours)

– Location: Room 419 Warren Weaver Hall

– I get bored when nobody visits!– If you cannot make my office hours, I

will be happy to make an appointment with you. Please try to give me advance warning when you need an appointment.

Option 2: Write to the class mailing list. Please do not send homework code to the list. 18

Page 19: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

19

syllabussyllabus

Chap. 1, Introductionto Java Chap. 2, Primitive Data Types Chap. 3, Control Statements Chap. 4, Methods Chap. 5, Arrays Chap. 6, Objects and Classes Chap. 7, Strings Chap. 8, Class Inheritance and Interfaces Chap. 9, Section 9.6. The wrapper classes. Chap. 12, Applets

Page 20: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

Object Orientated ProgrammingObject Orientated Programming

Objects – Reusable software components that model items in

the real world– Meaningful software units

Date objects, time objects, paycheck objects, invoice objects, audio objects, video objects, file objects, record objects, etc.

Any noun can be represented as an object

– Very reusable– More understandable, better organized, and easier to

maintain than procedural programming– Favor modularity

2000 Prentice Hall, Inc. All rights reserved.

20

Page 21: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

History of JavaHistory of JavaA group of 13 Sun employees including

James Gosling started the “Green Project” in 1991 with the intention of planning for the next wave in computing.

They designed the *7 which was “an interactive, handheld home-entertainment device controller with an animated touchscreen user interface”

Gosling’s contribution to the project was an entirely new processor independent language call “Oak”.

21

Page 22: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

22

History or Java (continued)History or Java (continued) To make a long story short, people at Sun

decided to use this new language for the web. At the Sun World conference in May 1995, Marc

Andreessen of Netscape announced an agreement to integrate Java into its browser – in a nutshell - webpages were no longer going to be static.

Over the next few years, java became very popular for writing applets (small programs included on webpages)

Today in addition to writing applets, Java is used for writing large applications as well as applications for mobile devices

For more on the history of Java, check out: http://java.sun.com/features/1998/05/birthday.html

Page 23: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

23

Characteristics of Java

Java is simple

Java is object-oriented

Java is distributed

Java is interpreted

Java is robust

Java is secure

Java is architecture-neutral

Java is portable

Java’s performance

Java is multithreaded

Java is dynamic

2003 Prentice Hall, Inc. All rights reserved.

Page 24: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

24

Basics of a Typical Java Basics of a Typical Java EnvironmentEnvironment

Java programs normally undergo five phases– Edit

Programmer writes program (and stores program on disk)

– Compile Compiler creates bytecodes from program

– Load Class loader stores bytecodes in memory

– Verify Verifier ensures bytecodes do not violate security

requirements

– Execute Interpreter translates bytecodes into machine language

2003 Prentice Hall, Inc. All rights reserved.

Page 25: Computer Science 1 Lecture 1: administrative details and Professor: Evan Korth New York University 1

25

Typical Java Typical Java environmentenvironment

PrimaryMemory

.

.

.

.

.

.

Disk

Disk

Disk

Editor

Compiler

Class Loader

Program is created in an editor and stored on disk in a file ending with .java.

Compiler creates bytecodes and stores them on disk in a file ending with .class.

Class loader reads .class files containing bytecodes from disk and puts those bytecodes in memory.

Phase 1

Phase 2

Phase 3

PrimaryMemory

.

.

.

.

.

.

Bytecode Verifier Bytecode verifier

confirms that all bytecodes are valid and do not violate Java’s security restrictions.

Phase 4

PrimaryMemory

.

.

.

.

.

.

InterpreterInterpreter reads bytecodes and translates them into a language that the computer can understand, possibly storing data values as the program executes.

Phase 5

2003 Prentice Hall, Inc. All rights reserved.