Introduction to Programming

 

Definitions

 

Computer Program

(Program, Source code )

 a sequence of instructions used to operate a computer to produce a specific results.

Programming

 is the process of writing instructions in a language that the computer can respond to.

Programming Language (P.L)

 set of instructions that can be used to construct a program .

Algorithm (pseudo code)

 computational procedure .Step by step sequence of instructions that describes how to perform a calculation.

Flowchart

 pictorial representation of the algorithm .

Interpreter

 a program translate each individual statement and execute it immediately.

Compiler

  a program translate all the statements in a source program .

Machine Language

 O's and 1's .

Coding

 converting an algorithm into a computer program .

Object program

 The machine language version of the original source .

Syntax

 a set of rules for formulating grammatically correct language statements.

 

Requirements à algorithm à  source codeà translation program à machine language program .

 

 

Programming Languages

 

Machine languages

 

Strings of numbers giving machine specific instructions

Example:

+1300042774
+1400593419
+1200274027

Assembly languages

 

English-like abbreviations representing elementary computer operations (translated via assemblers)

Example:

LOAD   BASEPAY
ADD    OVERPAY
STORE  GROSSPAY

High-level languages

 

Codes similar to everyday English

Use mathematical notations (translated via compilers)

Example:

grossPay = basePay + overTimePay

 

If all P.L provide the same features ,why there are so many P.L?

Because of the difference in the type of input data ,calculations needed and output reports required .

 

 

History of Programming Languages

 

FORTRAN

(John Backus)

FORmula TRANslation in 1957  for science and engineering applications.

COBOL

(Grace Hopper)

Commons Business Oriented Language in 1960s for business. (Grace Murray Hopper is not only the Mother of COBOL, not only one of the most important women in the history of computers, she is one of the most important people in the history of computers).

BASIC (Thomas Kurtz &

 John Kemeny)

Beginners All-purpose Symbolic Instruction Code developed in 1960s at Dartmouth College.

Pascal

Prof. Nicklaus Wirth

  • Developed in late 1970s , not acronym ,but is named after the seventeenth -century mathematician , Blaise Pascal

  • For teaching purpose .

  • It is so structured and that was one reason that Pascal did not gain wide acceptance in the scientific ,engineering and business fields.

C

(Dennis Ritchie)

  • Evolved in 1970s at AT&T Bell laboratories by Ritchie from two previous programming languages, BCPL and B.

  • Used to develop UNIX.

  • The C was a direct descendant of the language B, which was developed by Ken Thompson as a systems programming language for the fledgling UNIX operating system. B, in turn, descended from the language BCPL which was designed in the 1960s by Martin Richards while at MIT.

  • In 1971 Dennis Ritchie at Bell Labs extended the B language (by adding types) into what he called NB, for "New B". Ritchie credits some of his changes to language constructs found in Algol68, although he states "although it [the type scheme], perhaps, did not emerge in a form that Algol's adherents would approve of" After restructuring the language and rewriting the compiler for B, Ritchie gave his new language a name: "C".

  • Used to write modern operating systems.

  • Hardware independent (portable)

  • By late 1970's C had evolved to "Traditional C"

C++

Bjarne Stroustrup

  • The C++ Programming Language is basically an extension of the C Programming Language.

  • In 1983, with various versions of C floating around the computer world, ANSI established a committee that eventually published a standard for C in 1989.

  • In 1983 Bjarne Stroustrup at Bell Labs created C++.

  • C++ was designed for the UNIX system environment, it represents an enhancement of the C programming language and enables programmers to improve the quality of code produced, thus making reusable code easier to write.

 

C Standardization

Basics of a Typical C Program Development Environment