6ProgrammingConcepts - Programming Concepts[Please switch...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
(CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong 6. Programming Concepts - 1 http://www.cs.cityu.edu.hk/~helena Programming Concepts Programming Concepts [Please switch off your phone]
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
(CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong 6. Programming Concepts - 2 http://www.cs.cityu.edu.hk/~helena Programming Languages Earliest form of computer language In 1822, Charles Babbage designed a difference engine . The engine could be made to complete tasks only by changing the gears that executed the calculations. This earliest form of computer language is based on physical motion. The engine requires a series of instructions to perform a specific task. This is known as a programming language. Demonstration for the Difference Engine I Created by Charles Babbage's son, Henry Babbage [Source: http://www.virtualtravelog.net/projects/ComputerHistory/index.html ]
Background image of page 2
(CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong 6. Programming Concepts - 3 http://www.cs.cityu.edu.hk/~helena Programming Languages Overview Computer programs are written in programming languages. If a program contains even a very small error, the computer cannot understand it. A programming language is an artificial language based on a set of grammar rules. We use a programming language to convert an algorithm into a computer program to enable the computer to solve the problem. There are hundreds of programming languages: - some are general-purpose - some are specific-purpose, such as business programs or scientific programs (eg. APL) - see more here: http://www-users.cs.york.ac.uk/~susan/cyc/p/prog.htm Very often, more than one programming language may be suitable for a task.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
(CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong 6. Programming Concepts - 4 http://www.cs.cityu.edu.hk/~helena Programming Languages Examples of program codes in C and Pascal
Background image of page 4
(CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong 6. Programming Concepts - 5 http://www.cs.cityu.edu.hk/~helena Programming Languages Generations of Programming Languages The development of programming languages is classified in "generation". 1GL – machine language 2GL – assembly language 3GL – procedural language 4GL – declarative language First-generation language (1GL) Machine language: a string of 0s and 1s. Example, add EAX and EBX registers and store the result back to EAX: 03 C3 Instructions in machine languages are numbers stored as bytes. Can be understood by a computer at once. But it is hard to read and understand by us. Difficult to learn. Each type of computers understands its own machine language only: machine-dependent .
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/16/2011 for the course CS 1301 taught by Professor Dr.wong during the Winter '08 term at City University of Hong Kong.

Page1 / 26

6ProgrammingConcepts - Programming Concepts[Please switch...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online