1 / 19

Introducing Programming

In this lecture, you will learn what a program is, the differences between machine, assembly, and high-level languages, and how programming languages have evolved over time.

Download Presentation

Introducing Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introducing Programming

  2. Goals By the end of this lecture you should … • Understand what a program is. • Understand the differences among machine, assembly and high-level languages • Understand how programming languages evolved.

  3. What is a Program? • Sets of instructions that get the computer to do something • Programs may be a few lines or millions of lines of code • All instructions are translated, eventually, to machine language.

  4. Programming Tasks • Each program has three distinct purposes: • To gather input data. • To manipulate that data. • To give meaningful information back to the user (output).

  5. Families of Languages • Machine Languages • Assembly Languages • High Level Languages: • Procedural Languages • Object Oriented Languages

  6. Machine Languages • Machine language commands are comprised of binary digits (bits – 1s and 0s) which are translated to electrical impulses that get the computer to do something. • “Native” language of computers

  7. Assembly Languages • Assembly language commands are "shortcuts" for machine code that represent some basic commands. These commands still need to be translated to machine language. • Assembly language commands are hard-coded into a specific processor.

  8. High Level Languages • High level language commands are very close, in syntax, to English, thus resulting in comparatively low error rate. • High level commands need to be translated to machine language using an interpreter or compiler …

  9. Translation Using an Interpreter • Interpreters translate code into machine language on a line-by-line basis. • Typically, the translation speed is comparatively quicker than a compiler, but the execution speed is slower.

  10. Translation Using a Compiler • Compiler translate code into machine language by translating the entire program at once. • Typically, the translation speed is comparatively slower than an interpreter, but the execution speed is much quicker.

  11. Common Operations • All types of high level languages share three families of operations: • Sequential Operations • Conditional Operations • Looping Operations

  12. Sequential Operations • Sequential operations are lines of code that execute in order. • Sequential operations are the default operations in programming.

  13. Conditional Operations • Conditional operations (sometimes called decision structures) alter the course of a program based on the result of a TRUE/FALSE test. • Programmers construct those tests using relational operators.

  14. Looping Operations • Looping operations are those structures in which code repeats until a given condition is met. • Similar to conditional operations, programmers construct looping operations using relational operators.

  15. Procedural Languages • Early high-level languages were procedural in nature. • The focus of procedural languages was on structure. • Examples include QuickBasic, Fortran, Pascal, and early versions of Visual Basic.

  16. Object-Oriented Languages • Object-oriented languages are a more recent development, where the focus is on data (the “Primacy of Data”). • In OOP, programmers include data and the ways to manipulate that data into one entity – the object. Examples include Java, C# and VB.NET.

  17. Summary • A program is a set of instructions to get your computer to do something. • All programs have three basic types of instructions: (1) input instructions; (2) processing instructions and (3) output instructions.

  18. Summary • Machine languages are comprised of 1s and 0s and are the native languages of computers. • Assembly language commands are tied to specific processors and represent shortcuts to machine language.

  19. Summary • High level languages are close, in syntax, to English. To translate high-level languages, we must use compilers or interpreters. • All high-level languages share three basic groups of operations: sequential, conditional & looping.

More Related