{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

14ProgrammingConcepts - Programming Concepts[Please switch...

Info icon This 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 8. Programming Concepts - 1 http://www.cs.cityu.edu.hk/~helena Programming Concepts Programming Concepts [Please switch off your phone]
Image of page 1

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

View Full Document Right Arrow Icon
(CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong 8. 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 which 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 ]
Image of page 2
(CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong 8. 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.
Image of page 3

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

View Full Document Right Arrow Icon
(CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong 8. Programming Concepts - 4 http://www.cs.cityu.edu.hk/~helena Programming Languages Examples of program codes in C and Pascal
Image of page 4
(CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong 8. 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 .
Image of page 5

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern