Introduction to Computer Programming I CSE 113 Gaurav Kumar.

36
Introduction to Computer Programming I CSE 113 Gaurav Kumar

Transcript of Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Page 1: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Introduction to Computer Programming ICSE 113

Gaurav Kumar

Page 2: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 – Introduction toComputer Programming I

• Instructor: Gaurav Kumar• Office: 113V Davis Hall• Email: [email protected]• Email you send me should be from your UBIT

email account and should include your full name and which course you are taking.

Page 3: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 – Introduction toComputer Programming I

• Office Hours– Monday 12:00 - 1:00PM

Wednesday 12:00 - 1:00PM

Page 4: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Information on the Web

• All course content will be on the coursewebsite: http://www.buffalo.edu/~gauravku/summer/CSE113• UBLearns will be used to post course grades.

Page 5: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Course Structure

• Lecture (6 hours each week)– Monday, Wednesday 2:00 PM – 4:55 PM

• Recitation/Lab (2 hours each week)– Monday, Wednesday 5:00 – 5:50 PM

• You should be registered for a recitation section and a lecture.• Recitations do not meet on 06/25.

Page 6: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Course Description andPrerequisites

• This course is an introduction to computer programming for non-majors.Intended computer science or computer engineering students should not take this course.

• There are no prerequisites for this course, but you should have some familiarity with a computer (that is, you should have used one before).

Page 7: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Course Grades

• 45% - Exams– Three in-class exams. Dates will be posted on the

course website.• 35% - Programming Exams (2)– Two practical exams.– Dates will be listed on course website.

• 20% - Programming Assignments– 6 lab assignments each worth 2.5% of your grade. One

to 6 practice assignments worth a total of 5% of your course grade.

Page 8: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Textbook

• Michael Kölling – Introduction to Programming with Greenfoot: Object oriented Programming in Java with Games and Simulations

• The package (paper book and eBook) is available at the University Bookstore, Greeks and Sneaks, Amazon.

Page 9: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Course Grades

• Important Note:– If you do not attempt the second practical exam,

the highest grade you can earn in the course is an F.

– You will not be allowed to take the second practical exam if your grade on ANY of the 6 programming assignments is below 50%.

Page 10: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Letter Grades

• There is no curve on the course grades. If your average falls in between the cutoffs, that is your grade.

Score 90-100 85-89 80 –84 75 –79 70 –74 65 –69 60 –64 55 –59 50 –54 0 –49

Grade A A- B+ B B- C+ C C- D F

Page 11: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Course Policies

• Re-grading – any questions about graded work must be raised within one week of the return of the work.

• Incompletes – we will follow the university’s policy on incompletes –unless you meet the criterion, you will not get an incomplete.

• Disability Services – If you are registered, please bring me the letter indicating your accommodations.

• Athletics – If you are an athlete, please come to speak with me about how that will effect this course this semester.

Page 12: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Course Policies

• Disruption/Behavior in the Classroom– Take note of the University’s policy on thisissue (in syllabus)– Be respectful of each other

• Academic Integrity– Breaches of academic integrity will be investigated and

punishments imposed in accordance with the University’s policies AND my department’s policies.

– My department’s policy is that ANY breach of academic integrity is punished with an F in the course (no more lenient punishments allowed).

Page 13: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

FAQ

• Where are the slides posted?

Page 14: Introduction to Computer Programming I CSE 113 Gaurav Kumar.
Page 15: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 - Announcements

• Pick up (and READ) syllabus if you have not already done so.

• No recitations meet today.

Page 16: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 16

Quiz 1

What is Computer Programming ?Convincing the computer to never freezeSetting the alarm on a computerTelling the computer what to do through a

special set of instructionsSpeeding up your computer

Page 17: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 17

Quiz 1

What is Computer Programming ?Convincing the computer to never freezeSetting the alarm on a computerTelling the computer what to do through a

special set of instructionsSpeeding up your computer

Page 18: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 18

What Computer Understands ?

Page 19: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 19

What Computer Understands ?

Page 20: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 20

What Computer Understands ?

Page 21: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 21

What Human Understand?

Page 22: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 22

What Human Understand?

Page 23: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 23

What Human Understand?

Page 24: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 24

Solution

Bridge – Call it a Translator

Page 25: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 25

Flow

Compiler Object Code

Source Code Linker

Library

Executable Code

High Level Language

Machine Language

Page 26: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 26

Bug

Actual Bug found in Mary II , a Computer in Harvard Lab

Page 27: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 27

Architecture

Memory

ALUControl Unit

InstructionsInstr1Instr2Instr3Instr4

….

Input Output

PC

Page 28: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 28

Terms

• Algorithm – Recipes / Set of steps• Source code - Actual text used to write the

instructions for a computer program• Compiler - software tool that translates source code

into data that the computer can understand• Data type - classification of pieces of information in a

program• Variable - container which represents a value in a

program• Constant – It’s a CONSTANT

Page 29: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 29

More Terms

• Conditional - Set of code that will execute only if a certain condition is true

• Array - A list of related values• Loop - Segment of code that executes

repeatedly• Function - Set of code used to carry out specific

tasks• Class - Template for a real world object to be

used in a program

Page 30: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 30

Syntax vs Semantics

• Syntax – Not abiding by the guidelines/ set of rules

• Semantic – Meaningful. ( Logical )

• Cow Dog Giraffe – Syntax Error for writing a sentence in English Language

• My desk’s name is Gaurav – Semantically Wrong

Page 31: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 31

Quiz 2

Ask user for a number, ask user for another number, multiply the two numbers, print result.. What do you call this set of instructions? Instructions Code A compiler An algorithm

Page 32: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

CSE 113 32

Quiz 2

Ask user for a number, ask user for another number, multiply the two numbers, print result.. What do you call this set of instructions? Instructions Code A compiler An algorithm

Page 33: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Programming Language

• Language we can use to write computer programs.

• Similar to and different from natural language

Page 34: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Similarities to NaturalLanguage

• Syntax - Grammar• Semantics - Meaning• Written down• Read

Page 35: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Differences from NaturalLanguage

• Rarely spoken

Page 36: Introduction to Computer Programming I CSE 113 Gaurav Kumar.

Tools

• Editor – Place to type the program• Compiler - Translator• Execution Environment