15
EC201 – FUNDAMENTAL PROGRAMMIN G UNIT 1 – INTRODUCTORY TO PROGRAMMING

UNIT 1_DIS 2014

Embed Size (px)

DESCRIPTION

Introduction to programming

Citation preview

  • EC201

    FUNDAMENTAL

    PROGRAMMIN

    G UNIT 1 INTRODUCTORY TO

    PROGRAMMING

  • 1.1 INTRODUCTION TO PROGRAMMING

    CONCEPT AND TERMINOLOGY

    Definition of Programming Terms

    PROGRAMME

    A set of instructions that enables the

    computer to perform a certain task.

    OR

    A sequence of instructions that a

    computer can interpret and

    execute. The program required

    several hundred lines of code.

  • PROGRAMMER

    A person writes a program so that data may

    be processed by a computer.

    OR

    A person writes computer software.

    Computer software is a collection of

    computer programs and related data that

    provides the instructions for telling a

    computer what to do and how to do it.

    http://en.wikipedia.org/wiki/Computer_softwarehttp://en.wikipedia.org/wiki/Computer_programhttp://en.wikipedia.org/wiki/Datahttp://en.wikipedia.org/wiki/Computer
  • PROGRAMMING LANGUAGE

    A programming language is an artificial

    language designed to express computations

    that can be performed by a machine,

    particularly a computer.

    Programming languages can be used to create

    programs that control the behavior of a

    machine, to express algorithms precisely, or as a

    mode of human communication.

    http://en.wikipedia.org/wiki/Languagehttp://en.wikipedia.org/wiki/Computationhttp://en.wikipedia.org/wiki/Machinehttp://en.wikipedia.org/wiki/Computerhttp://en.wikipedia.org/wiki/Program_(machine)http://en.wikipedia.org/wiki/Algorithm
  • THE VARIOUS TYPES OF POPULAR

    PROGRAMMING LANGUAGES

    BASIC

    BASIC (Beginner's All-purpose Symbolic Instruction

    Code) is a family of high-level programming

    languages to provide computer access to non-

    science students.

    Example:

    main( )

    {

    printf(HELLO WORLD");

    }

    http://en.wikipedia.org/wiki/High-level_programming_languagehttp://en.wikipedia.org/wiki/High-level_programming_languagehttp://en.wikipedia.org/wiki/High-level_programming_languagehttp://en.wikipedia.org/wiki/High-level_programming_language
  • QBasic

    QBasic (QuickBASIC) is an IDE (integrated

    development environment) and interpreter for a

    variant of the BASIC programming language.

    Like QuickBASIC, but unlike earlier versions of

    Microsoft BASIC, QBasic is a structured

    programming language, supporting constructs

    such as subroutines and while loops.

    Example: PRINT "Hello, World!"

    http://en.wikipedia.org/wiki/QuickBASIChttp://en.wikipedia.org/wiki/Integrated_development_environmenthttp://en.wikipedia.org/wiki/Integrated_development_environmenthttp://en.wikipedia.org/wiki/Integrated_development_environmenthttp://en.wikipedia.org/wiki/Interpreted_languagehttp://en.wikipedia.org/wiki/BASIC_programming_languagehttp://en.wikipedia.org/wiki/Structured_programminghttp://en.wikipedia.org/wiki/Structured_programminghttp://en.wikipedia.org/wiki/Subroutineshttp://en.wikipedia.org/wiki/While_loop
  • Visual Basic

    Visual Basic (VB) is the third-generation event-

    driven programming language and integrated

    development environment (IDE) from Microsoft for

    its COM programming model.

    Because of its graphical development features

    and BASIC heritage, VB is considered to be

    relatively easy to learn and use.

    Example:

    Private Sub Form_Load()

    ' Execute a simple message box

    that will say "Hello, World!"

    MsgBox "Hello, World!"

    End Sub

    http://en.wikipedia.org/wiki/Third-generation_programming_languagehttp://en.wikipedia.org/wiki/Third-generation_programming_languagehttp://en.wikipedia.org/wiki/Third-generation_programming_languagehttp://en.wikipedia.org/wiki/Event-driven_programminghttp://en.wikipedia.org/wiki/Event-driven_programminghttp://en.wikipedia.org/wiki/Event-driven_programminghttp://en.wikipedia.org/wiki/Integrated_development_environmenthttp://en.wikipedia.org/wiki/Integrated_development_environmenthttp://en.wikipedia.org/wiki/Microsofthttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/BASIC
  • C

    C (pronounced /si/ see) is a designed for

    implementing system software and used for

    developing portable application software.

    C is a computer programming language

    developed in 1972 by Dennis Ritchie at the Bell

    Telephone Laboratories for use with the Unix

    operating system.

    Example : #include

    int main(void)

    {

    printf("hello, world\n");

    return 0;

    }

    http://en.wikipedia.org/wiki/Wikipedia:IPA_for_Englishhttp://en.wikipedia.org/wiki/Wikipedia:IPA_for_Englishhttp://en.wikipedia.org/wiki/Wikipedia:IPA_for_Englishhttp://en.wikipedia.org/wiki/Wikipedia:Pronunciation_respelling_keyhttp://en.wikipedia.org/wiki/System_softwarehttp://en.wikipedia.org/wiki/Application_softwarehttp://en.wikipedia.org/wiki/Programming_languagehttp://en.wikipedia.org/wiki/Dennis_Ritchiehttp://en.wikipedia.org/wiki/Bell_Telephone_Laboratorieshttp://en.wikipedia.org/wiki/Bell_Telephone_Laboratorieshttp://en.wikipedia.org/wiki/Unixhttp://en.wikipedia.org/wiki/Operating_system
  • C++

    C++ (pronounced /si plas plas/ see plus plus) is a

    statically typed, free-form, multi-paradigm,

    compiled, general-purpose programming

    language.

    It is regarded as a "middle-level" language, as it

    comprises a combination of both high-level and

    low-level language features.

    Example :

    #include

    int main()

    {

    std::cout

  • TYPES OF PROGRAMMING LANGUAGES

    STRUCTURED PROGRAMMING

    A technique for organizing and coding computer programs in which a hierarchy of modules is used, each having a single entry and a single exit point, and in which control is passed downward through the structure without unconditional branches to higher levels of the structure.

    Three types of control flow are used: sequential, test, and iteration.

    http://www.its.bldrdoc.gov/fs-1037/dir-007/_1049.htmhttp://www.its.bldrdoc.gov/fs-1037/dir-008/_1184.htm
  • MODULAR PROGRAMMING

    is a software design technique that increases the extent to which software is composed of separate, interchangeable components, called modules.

    Conceptually, modules represent a separation of concerns, and improve maintainability by enforcing logical boundaries between components.

    Modules are typically incorporated into the program through interfaces.

    http://en.wikipedia.org/wiki/Separation_of_concernshttp://en.wikipedia.org/wiki/Separation_of_concernshttp://en.wikipedia.org/wiki/Maintainabilityhttp://en.wikipedia.org/wiki/Interface_(computer_science)
  • A module interface expresses the elements

    that are provided and required by the

    module.

    The elements defined in the interface are

    detectable by other modules.

    The implementation contains the working

    code that corresponds to the elements

    declared in the interface.

    http://en.wikipedia.org/wiki/Implementation
  • Object-oriented programming (OOP)

    is a programming paradigm that uses "objects" data structures consisting of data fields and methods together with their interactions to design applications and computer programs.

    Programming techniques may include features such as data abstraction, encapsulation, modularity, polymorphism, and inheritance.

    Many modern programming languages now support OOP.

    http://en.wikipedia.org/wiki/Programming_paradigmhttp://en.wikipedia.org/wiki/Object_(computer_science)http://en.wikipedia.org/wiki/Data_structurehttp://en.wikipedia.org/wiki/Field_(computer_science)http://en.wikipedia.org/wiki/Method_(computer_science)http://en.wikipedia.org/wiki/Data_abstractionhttp://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming)http://en.wikipedia.org/wiki/Module_(programming)http://en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programminghttp://en.wikipedia.org/wiki/Inheritance_(computer_science)http://en.wikipedia.org/wiki/Programming_language
  • 14

    Phases of C Programs:

    1. Edit

    2. Preprocess

    3. Compile

    4. Link

    5. Load

    6. Execute

    Loader

    Primary

    Memory

    Program is created in

    the editor and stored

    on disk. Preprocessor program

    processes the code.

    Loader puts program

    in memory.

    CPU takes each

    instruction and

    executes it, possibly

    storing new data

    values as the program

    executes.

    Compiler

    Compiler creates

    object code and stores

    it on disk. Linker links the

    object code with the

    libraries,creates a.out and stores it

    on disk

    Editor

    Preprocessor

    Linker

    CPU

    Primary

    Memory

    .

    .

    .

    .

    .

    .

    .

    .

    .

    .

    .

    .

    Disk

    Disk

    Disk

    Disk

    Disk

    Basics of a Typical C

    Environment

  • SUMMARY

    Terms in programming :

    Programme

    Programmer

    Programming

    language

    Various types of

    programming language:

    C language

    C++ language

    BASIC

    QBASIC

    Visual Studio

    Pascal

    Types of programming:

    Structured programming

    Modular programming

    Object-oriented programming