Presentation is loading. Please wait.

Presentation is loading. Please wait.

ITEC 109 Lecture 3 Intro to programming. Review Problem solving –Stages? –Potential pitfalls.

Similar presentations


Presentation on theme: "ITEC 109 Lecture 3 Intro to programming. Review Problem solving –Stages? –Potential pitfalls."— Presentation transcript:

1 ITEC 109 Lecture 3 Intro to programming

2 Review Problem solving –Stages? –Potential pitfalls

3 Intro to programming Objectives Mental model of languages Relationship with hardware What you can and can’t do

4 Intro to programming Computers What is on the inside? What do the parts do?

5 Intro to programming Binary Computers speak binary Command => Result CPU –Registers –Calculations Memory Hard drives Graphic cards

6 Intro to programming Old way Figure out the binary for the command you wanted Figure out where to get the input Figure out where to put the output Put it together Result –01101101 Long programs?

7 Intro to programming Frustration Speaking in binary isn’t appealing Work faster if we speak in natural languages Assembly=>Java=>Python Translation –Ambiguity issue

8 Intro to programming Language s Abstract away from hardware Whole greater than sum of parts Several variations –6000+ languages in the world –Over 300 listed on Wikipedia

9 Intro to programming Classificatio n Compiled –Java Scripting –Python

10 Intro to programming Component s Languages have constructs –Variables –Flow control –Grouping Sentence => Statement Statement => Constructs Program has many statements

11 Intro to programming Types of statements Create resources Modify resources Alter the flow –Ignore a few statements –Go back and repeat some of them again

12 Intro to programming Mental model 1.x=3; 2.Number = raw_input(‘Enter a number’); 3.printNow( “You picked “ + Number); 4.printNow(“ The computer picked”‘ + x); Linear list Programs start at a particular line and execute one after the other as fast as possible

13 Intro to programming Mental model Branching x=3;x=4; Looping x=x+1; print ‘x’ print ‘Time to go around again’

14 Intro to programming Mental Model Process Order Process Order Ship Order Ship Order start

15 Intro to programming Process Read the problem Work through it by hand Make sure you can envision how it will work before you start Writing statements before mentally seeing the light at the end of the tunnel = BAD

16 Intro to programming Design Formalize what you know about the program Write down what statements / grouping is needed Work out math beforehand if needed Think how to test the software

17 Intro to programming Implementatio n Write a few statements, check Write on paper first, then computer Read code and see what it does in your mind

18 Intro to programming Testing Figure out what could go in, what goes out Make test cases Run them Modify statements when you are finished

19 Intro to programming Help Peer tutors Office hours Friends (though only specific questions)

20 Intro to programming Review Computer hardware Languages Statements


Download ppt "ITEC 109 Lecture 3 Intro to programming. Review Problem solving –Stages? –Potential pitfalls."

Similar presentations


Ads by Google