Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 645-4739 1.

Similar presentations


Presentation on theme: "CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 645-4739 1."— Presentation transcript:

1 CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 645-4739 alphonce@buffalo.edu 1

2 Announcements Cell phones off Name signs out 2

3 Last class Instructions are encoded as bit strings Machine languages Fetch-Decode-Execute cycle Assembly languages 3

4 Today’s lessons High-level languages Requirements for a programming language 4

5 Low-level languages Machine language –1101000001000010 Assembly language –ADD R1 R2 5

6 High level languages Java –We can write “x + y” instead of “ADD R1 R2” (in addition to with several MOV instructions) Others: C#, Erlang, Python, ML, Prolog, Lisp, etc. 6

7 Translation LLL  LLL is called assembly –there is a 1:1 translation from assembly to machine language –fairly simple process HLL  LLL is called compilation –there is no 1:1 translation –translation is quite complex –optimizations can be applied to make low level code more efficient 7

8 Requirements of a PL Sequencing Selection Repetition 8

9 Equivalences Computation models –Turing Machine –Lambda calculus Programming languages –Java –C# –Prolog –Python 9

10 High-level languages Easier syntax than –Machine language (bit strings) –Assembly language (mnemonic) Must be translated (compiled) to machine language 10

11 Java A modern high-level language Object-oriented Large libraries (Relatively) simple core language 11

12 Questions? 12

13 Moving on… We will return to low-level issues later in the semester, and also in later courses. This brief low-level discussion gives context for upcoming topics. Now we turn to some higher-level issues.

14 I have a question for you! What did you have for breakfast today?

15 Activity The goal of this short activity is to demonstrate two things: 1.objects have behaviors 2.sending message to objects can trigger those behaviors

16 Activity details 3 volunteers, a.k.a. objects When I tell you… (I) …you should… (II) …you should… (III) …you should… STARTbegin doing jumping jacksstart counting slowly, 0…1…2… etc, but always starting at zero do nothing STOPstop jumping, and stand normally stop counting, but remember where you left off do nothing CONTINUEdo nothingkeep counting up from where you left off do nothing anything elsedo nothing

17 Activity Review Why did we do this activity? –To introduce the idea of an object. What is an object? –It is a representation of something in our problem domain –It has both: CAPABILITIES PROPERTIES / STATE


Download ppt "CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 645-4739 1."

Similar presentations


Ads by Google