Programming Languages, Algorithms and Flowcharting, Slides of C programming

The document introduces the concept of computer and programming languages. It explains the difference between data and information, the devices that comprise a computer system, and the types of programming languages. It also discusses the advantages and disadvantages of low and high-level programming languages, and the concept of algorithm and pseudo code. useful for students who want to learn the basics of programming languages and algorithms.

Typology: Slides

2021/2022

Available from 08/21/2022

SamenKhan
SamenKhan 🇵🇰

231 documents

1 / 34

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22

Partial preview of the text

Download Programming Languages, Algorithms and Flowcharting and more Slides C programming in PDF only on Docsity!

What is a Computer?

  • A computer is an electronic device that can follow instructions to - Accept input (data) - Process that input - Produce output (information) Data is raw, unorganized facts that need to be processed. Data can be something simple and seemingly random and useless until it is organized When data is processed, organized, structured or presented in a given context so as to make it useful, it is called Information Each student's test score The class' average score or the school's average score For Example For Example

What does a Computer do?

  • Computers perform four general operations, which make up the information processing cycle - Input - Process - Output - Storage http://www.buzzle.com/articles/information-processing-cycle.html

Devices that Comprise a Computer System

Printer (output) Monitor (output) Speaker (output) Scanner (input) Mouse (input) Keyboard (input) System Unit (processor, memory) Storage Devices (CD-RW, Floppy, Hard disk etc)

Computer Programming ‘The Computer’ ‘The Programmer’ I only know Binary 0s and 1s How do I make the Computer ‘process’ my data? Answer Tell Computer what you want to get done

Computer Programs ‘The Computer’ ‘The Programmer’ Programmer writes a ‘set of instructions’ for Computer This set is called a ‘Computer Program’

Programming Languages

  • Each natural language has a systematic method of using symbols of a language. This is dictated by rules of grammar – semantic (structure)and syntax (words and symbols)
  • Similarly, computer programming languages are governed by the structure and syntax.
  • In natural languages one can break the syntax rule such but we can use inference (guesswork) to get what the person means.
  • However, computer being a machine are receptive to only the exact syntax rules of the language being used.

Types of Programming Languages

  • Programmers write these instructions in different programming languages. Programming Languages Requiring intermediate translation steps Directly understandable by Computer Machine Languages Assembly Languages High Level Languages

Types of Programming

Languages

2. High-level languages further classified into three generations namely: - Third Generation- Procedural languages - Fourth Generation - Problem-oriented languages - Fifth Generation - Natural languages

Low Level Languages MACHINE LANGUAGES (1GL)

  • This is the oldest form of computer programming. Plug boards were used to represent data in binary (machine) form in the computer circuitry. Data represented in 1s and 0s are said to be written in machine language. For example, the code below represent a segment of a machine code: - 1011010100 - 1010111101 - 1000100100
  • Machine language also varies according to make of computer
    • another characteristic that make them hard to work with.

ASSEMBLY LANGUAGES (2GL)

  • Assembly language use mnemonics such as ADD that are automatically converted to the appropriate sequence of 1s and 0s by a translator called assembler.
  • Compared to machine languages, assembly languages are much easier for humans to understand and to use.

17

High level languages PROCEDURAL LANGUAGES (3GL)

  • Procedural languages, also known as third generation languages uses human like language. They are intended to solve general problems. Examples of procedural languages are C, Pascal, FORTRAN, COBOL etc.
  • Like assembly languages, procedural languages must be translated into machine language so that the computer processes it. Depending on the language this translation is performed by either a compiler or an interpreter.
  • A compiler converts the programmer's procedural language program, called the source code, into a machine language called the object code. This object code can then be saved and run later. Examples of procedural languages using compilers are the standard version of PASCAL, COBOL, and FORTRAN.
  • An interpreter converts the Procedural languages one statement at a time into machine code just before it is to be executed. No object code is saved. An example of procedural language using an interpreter is the standard version of BASIC, Python. High level languages-Translators