Docsity

Introduction to Computer Programming - Lecture Slides | ECS 010, Exams of Computer Science

Partial preview of the text

Download Introduction to Computer Programming - Lecture Slides | ECS 010 and more Exams Computer Science in PDF only on Docsity!

1

ECS 10: Basic Concepts

of Computing

Prof. Michael Gertz

[email protected]

March 31, 2008

2

Introductions

„ Professor Michael Gertz

„ ZiJie Qi

„ Yugandhar Muppala

„ Course Web site

http://dbis.ucdavis.edu/courses/ECS10-SQ08/

3

A first programming class

„ For people with no programming experience

„ Learn the computer programming language

Python

„ Write small to medium-size programs in

assignments and exams

4

Why learn to program?

„ Understand computers

„ Computers are used in almost every career

„ Improve your problem solving skills

„ The programs you have are never exactly what

you want. Example:

„ UCD Student Health Center

„ UCD Medical Center Hospital medical record, OR…
„ Extensions of current system
„ How to connect them?

7

Image gallery of a zoom sequence

„ Magnification of the last image relative to the first one is about
60,000,000,000 to 1. If Step 14 has the size of an ordinary monitor, then
the whole set (Step 1) needs a monitor with a diagonal of 20 million
kilometers. That’s >50x the distance Earth – Moon! Its border shows
an inconceivable amount of different fractal structures.

8

How one starts … END of Digression]

The First 10,000 Primes (the 10,000th is 104,729) http://primes.utm.edu/

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009 1013 1019 1021 1031 1033 1039 1049 1051 1061 1063 1069 …

„ A prime number p is

one that has exactly

two factors: 1 and p.

„ prime numbers:

„ not a prime:

„ e.g. 4 (=22), 6 (=23),

9

Programming teaches you to think!

„ The computer is your genie in a bottle

„ It does exactly what you tell it to

„ Your job is figuring out what to tell it

„ Learning the language (syntax and semantics) is

the easy part; learning to give exact directions is

the hard part

„ Some people really like it!

10

Example: draw ball

„ drawBall(1,1) #Draw the ball at position 1,

13

Why Python?

„ Easy to start with, easy to implement and test ideas

„ Freely available for many platforms!

„ Widely used in industry – Google, ILM, NASA,

Honeywell… (see http://www.python.org/about/success)

„ Lots of “libraries” (add-ons) that do things like sound

editing, scientific computing, Web database access….

(3200+ packages).

„ Great for interfacing one

program to another

14

Other course options

„ ECS-15 – More conceptual overview.

Understanding how computers and the Internet

work, a little programming.

„ ECS-30 – More intensive class for those with

some programming experience.

Learn C (C++ in ECS 40). Required for ECS

majors.

15

Course structure

„ 6 Programming assignments:

„ 35% of total grade (Midterms 1+2 = 35%, Final 30%)

„ Example programming assignments (previous classes):

„ Using Python (“Hello World”)
„ Interactive quiz
„ Compound interest
„ Exam analyzer
„ Fun with primes
„ Text analyzer + graphing/plotting data

„ All programming assignments are INDIVIDUAL

assignments.

„ First assignment will be posted on Friday this week!

16

Exams

„ Midterms – 35%

st

Midterm: Monday 4/21, in class

nd

Midterm: Monday 5/12, in class

„ If you miss a midterm, either:

„ give me a note from Student Health
„ get permission at least one week ahead of time

„ Final – 30%

„ Thursday 6/12, 10:30am-12:30pm, 106 Wellman

„ DO NOT leave campus before this final

„ All exams are open book and open notes

19

Flash drive

„ If you work in the computer classrooms, you

might want to use a flash drive for your programs

(or use my.ucdavis.edu).

20

Lecture: 106 Wellman

Office Hrs: 3029 Kemper

Disc. Sec.: 117 Olson

Disc. Sec.: 227 Olson

Disc. Sec.: 192 Young

Disc. Sec.: 115 Wellman

Lab hours: 1131 Meyer Hall

Lab hours: 73 Hutchison

Lecture: 106 Wellman Lecture: 106 Wellman

Office Hrs: 3029 KemperOffice Hrs: 3029 Kemper

Disc. Sec.: 117 OlsonDisc. Sec.: 117 Olson

Disc. Sec.: 227 OlsonDisc. Sec.: 227 Olson

Disc. Sec.: 192 YoungDisc. Sec.: 192 Young

Disc. Sec.: 115 WellmanDisc. Sec.: 115 Wellman

Lab hours: 1131 Meyer HallLab hours: 1131 Meyer Hall

Lab hours: 73 HutchisonLab hours: 73 Hutchison

21

Start of discussion sections & lab hours

„ In the discussion sections this week, the installation and

usage of the Python programming environment will be

discussed as well as course topics covered by then.

„ You can go to lab sections starting Thursday, if you

bring your laptop, we can help installing Python

„ My first office hours are next Tuesday 1:30-2:30pm

st

assignment will be posted on Web site by Friday

(check also my.ucdavis.edu); due in about one week

„ see “Late Day Policy” on course Web site

22

Professional conduct

„ I am expecting professional, adult behavior

„ Politeness

„ No eating in class
„ No cell phone calls
„ “Business letter” emails

„ Honesty

„ Write and understand every line of every program
„ No cut-and-paste
„ No looking at other people’s programs while typing

See also class Web site under “Academic Conduct”