27
Computer Science 227 Introduction to Programming Iowa State University Lecture 1 (Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 1/1

Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Computer Science 227

Introduction to Programming

Iowa State University

Lecture 1

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 1 / 1

Page 2: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Welcome to Computer Science 227.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 2 / 1

Page 3: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Computational Thinking

Think like a computer scientist.

Problem solving skills—Ability to think logically, algorithmically, and

recursively.

Ability to think in abstract terms.

Solve problems from other domains via computational thinking

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 3 / 1

Page 4: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Instructors

Pavan Aduri

Atanasoff 102, [email protected]

Office Hours TBA

MWF 1:10–2, Carver 101

Steve Kautz

Atanasoff B6, [email protected]

Office Hours TBA

MWF 9:00–9:50, Carver 305

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 4 / 1

Page 5: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Teaching Assistants

Cover labs

Hold office hours

Grading, etc.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 5 / 1

Page 6: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Lectures

We love to see you in lectures...

Attending lectures is optional.

This means only that there are no points assigned specifically to

attendance.

However, any material presented or announcements made in lecture

are your responsibility to know.

If you are having difficulty with material or struggling in the class, it is

strongly recommended that you attend all lectures and labs.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 6 / 1

Page 7: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

If you choose to read newspaper, do homework in lecture, or sleep

thats fine. But please do not disturb the class.

Your grade will be based on homework and tests, not on attendance.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 7 / 1

Page 8: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Labs

Labs will be taken by the Teaching Assistants.

We will use the lab sessions to answer questions about homework

assignments, to return exams, to cover supplementary material, and

to answer questions about the computer systems.

Enrollments are limited to 20 students each to give each student

access to a workstation during the lab.

All labs in Pearson 0108.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 8 / 1

Page 9: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

No Labs during the first week of classes.

Labs start from Monday 8/29.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 9 / 1

Page 10: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Each Lab:

Read some lab material. Re-enforcing concepts from lecture + new

topics.

Check points—Small programming excercise.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 10 / 1

Page 11: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Home Works

There will be 4–5 Homeworks (in addition to lab excercises)

Major Programming problems. You typically have 2–3 weeks to finish

them.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 11 / 1

Page 12: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Exams

2 mid term exams and a final exam.

First Midterm: Sep 29, 6:30–7:45pm

Second Midterm: Nov 10, 6:30–7:45pm.

Final Exam: TBA.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 12 / 1

Page 13: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Grades

Exam 1: 15%

Exam 2: 15%

Final Exam : 25%

Lab Exercises: 10%

Homeworks: 35 %

90 and above A-

80 and above B-

70 and above C-

60 and above D-

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 13 / 1

Page 14: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Course Text Book

Big Java by Cay Horstmann, 4th edition

OR

Java Concepts by Cay Horstmann, 6th edition

Essentially identical for the first 15 chapters (which include everything

we cover in this course). Big Java includes 9 more chapters covering

a lot of extra stuff that could be interesting to read.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 14 / 1

Page 15: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Background

Having some prior programming experience helps, but not necessary.

High School Mathematics: Rational numbers, Complex numbers,

functions, polynomials, binary numbers, sets, matrices etc.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 15 / 1

Page 16: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Com S 104: Introduction to Computers

Instructor: Ming Hua

email: [email protected]

MW: 4:10–5:00pm

First Half: 8/22–10/14.

Second Half: 10/17–12/16.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 16 / 1

Page 17: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Academic Dishonesty

Each assignment is to be the product of your own intellectual effort.

Any student found guilty of academic dishonesty will receive an F

grade for the course.

Additionally, we will adhere to university policies regarding academic

dishonesty, which means that you may receive any of the penalties

described in the Policies and Practices section of the Student

Handbook under Academic Dishonesty.

ZERO TOLERANCE.(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 17 / 1

Page 18: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Plagiarism: If you present the work of someone else as if it were your

own, you are guilty of plagiarism. Plagiarism is unethical at every

level of every profession.

Tendering information: If you make your assignment available for

someone else to copy, you are guilty of tendering information, which is

also considered to be a form of academic dishonesty.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 18 / 1

Page 19: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Seek help

If you are having trouble with material, please seek help immediately.

Instructors, Teaching Assistants, Blackboard Discussion boards...

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 19 / 1

Page 20: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Blackboard

Obtain your ISU network ID.

If you do not have ISU network ID, get one using the following web

address:

https://asw.iastate.edu/cgi-bin/acropolis/register

There is a link to Blackboard from the main ISU web page.

Use your ISU ID and Password to Login.

You will find Com S 227 (possibly some other courses).

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 20 / 1

Page 21: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Questions?

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 21 / 1

Page 22: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Program

A sequence of “Simple Instructions”.

Result of running/executing a program: “Perfom a Complex task”.

Program is like a recipe.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 22 / 1

Page 23: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

A Recipe

Preheat oven to 350 degrees. Then place chicken pieces in a fairly large casserole dish.

Place all curry sauce ingredients in a food processor or blender. Process well. Pour the curry sauce over the chicken.

Add the chopped eggplant (if using), plus kaffir lime leaves/bay leaf and cinnamon stick, mixing everything into the

sauce. Cover and bake 45 minutes at 350 degrees.

Remove dish from oven. Add the bell pepper and tomato, stirring them into the sauce. Return curry to the oven for

15-20 minutes, or until both chicken and vegetables are well cooked.

Do a taste test, looking for a balance of flavors. If not salty or flavorful enough, add up to 1 Tbsp. more fish sauce. If

too salty, add more fresh lime juice. If too sour, add a little more brown sugar.

Ladle the curry into a large serving bowl. Sprinkle generously with fresh basil and coriander (cilantro), and serve with

plenty of Thai jasmine-scented rice. ENJOY!

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 23 / 1

Page 24: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Program – Adding numbers

Add digits in Zero’ Column

Is there a Carry?

Add digits in Tens’ column

Is there a carry?

· · ·· · ·

Basic Instruction: Adding single digits.

Program for Multiplication?

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 24 / 1

Page 25: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Programs for Machines — Computer Programs

Computers can perform certain basic instructions.

A computer program is a sequence of basic instructions.

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 25 / 1

Page 26: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Toy Example

Toy Computer with Basic Instructions:

draw line – Draws a 5 inch line

turn right

turn left

erase line – Erases 3 inches of a previously drawn line

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 26 / 1

Page 27: Computer Science 227 Introduction to Programmingweb.cs.iastate.edu/~pavan/227/F11/lectures/Aug22.pdf · (Iowa State University) Computer Science 227 Introduction to Programming Lecture

Toy Example

A program to draw a 5 × 5 square

draw line

turn right

draw line

turn right

draw line

turn right

draw line

How about a 10 × 10 Square?

How about a 9 × 9 square?

(Iowa State University) Computer Science 227 Introduction to Programming Lecture 1 27 / 1