CP104 - Reminders

Post on 01-Jan-2016

44 views 1 download

Tags:

description

CP104 - Reminders. *** Labs start this week! *** Challenge for credit for students with strong previous computer programming background Friday Sept 12, 2:30-4:30 location TBA by Wednesday 4pm, email me if interested, tell me what language you want to write in - PowerPoint PPT Presentation

transcript

CP104 - Reminders*** Labs start this week!*** Challenge for credit - for students with strong previous computer

programming background- Friday Sept 18, 2:30-4:30 <= MAY CHANGE- location TBA- by Wednesday Sept 16 4pm, email me if interested,

tell me what language you want to write in- if writing through accessible learning, you must let

them know so arrangements can be made

Computers are everywhere!

-5% are “traditional”

-95% are “embedded”

Hardware vs Softwarephysical devices composed of:

-input units-output units-secondary storage -> stores programs and data (device off)

-main memory -> stores program and data (while running)

-central processing unit -> runs the program

program required to run the device-set of instructions that the processor follows to perform a task-types (text breakdown)

-operating system-utility programs-software development tools-application programs

Programming Languages

Application Language LayerHigh Level Language

Assembly Language(Low Level Language)

Machine Language

Hardware

Operating System(Operating

System Calls)

Programming LanguagesProgramming Languages- grammar varies by language and is rigid- static- 1,500 [99 Bottles of Beer]- paradigms: procedural, object-oriented, functional, logical- typing: static, dynamic

Natural Languages- grammar varies by language- dynamic- 7,000- families: Sino-Tibetan, Indo-European, Afro-Asiatic, Austronesian- pitch: intonation, tone

The TIOBE Programming Community index and the IEEE Top 10 Languages are indicators of the popularity of the top 100 programming languages.

The World Atlas of Language Structures is a large database of structural properties of languages.

Procedural Languages- procedural programs specify a series of

computational steps to be carried out- in real life, comparable to writing

- recipes, - instructions to build a model airplane,- instructions to construct a bookshelf from a

wood working magazine, - instructions to put together “assembly

required” furniture

Mac and Cheese• 3 fundamental constructs of procedures:

• sequential steps• decision structures• repetition

• Consider “Heat the milk in a medium saucepan over medium-high heat until it just comes to a simmer, then turn off the heat and set aside.”

Sample Python program"""------------------------------------hello_world.pyClassic hello world program------------------------------------Author: Nora ZnotinasID: 123456789 Email: nznotinas@wlu.caVersion: _updated_= 2014-09-03------------------------------------"""print ( “Hello, world!" )

tts.say("Hello, world!")

To run a program …

1. program and data are written in high level language

2. (a) compile program HLL -> LLL -> machine code

(b) interpret program

HLL -> LLL -> machine code