159138_633718968506885868

Upload: shweta-belnekar

Post on 10-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/8/2019 159138_633718968506885868

    1/27

  • 8/8/2019 159138_633718968506885868

    2/27

    Problem Solving using Computer

    Steps

    1. Understanding of the problem ?2. Methods and Logic to solve the problem.

    3. Flow-Chart /Algorithm / Decision Tables /

    Pseudo Code.4. Computer language ? Coding ? (Programming)

    5. Execution and producing the results.

  • 8/8/2019 159138_633718968506885868

    3/27

    Steps1. Understanding of the problem :- Problem

    should be clear to us. We should know, whatis given ? What is to be done ?

    2. Methods and Logic to solve the problem :We should know how to solve the problem.

    If we dont know the method and logic tosolve the problem, the computer cant help.

  • 8/8/2019 159138_633718968506885868

    4/27

    The computer can do only five operations :

    Additions

    Substractions

    Multiplications

    Divisions

    Compare

    The computer can do these calculation at very high

    speed.

  • 8/8/2019 159138_633718968506885868

    5/27

    4.Computer Language : Why we need computerlanguage ? Because, computer understands

    only the computer language, the computer

    dont understand our languages like English,Hindi, Punjabi etc.

    So we have to give instructions in one of the

    computer languages ?

    Program Instructions written in computer

    language.

  • 8/8/2019 159138_633718968506885868

    6/27

    Types of Computer Languages :-

    A. Low level languages

    B. High level languages

    C. Data Base languages

  • 8/8/2019 159138_633718968506885868

    7/27

    A)Low-level languages Historically Low-level languages weredeveloped first. Low level languages are machine dependent.Every manufactures develop their own language. The low-level languages vary from machine to machine. If one learnsand works on one machine, after changing the computer, one

    has to learn again new language for the new machine. That iswhy the computer remains with the manufactures or with theuniversities and with the research institutes. Low levellanguages are of two types

    a) Machine languages

    b) Assembly languages

  • 8/8/2019 159138_633718968506885868

    8/27

    a) Machine language : Strings of numbers givingspecific instructions.

    Example :

    + 1300042774

    + 1450212674

    + 1303245574

    These codes vary from machine to machine. Learning ofthe machine language is difficult.

  • 8/8/2019 159138_633718968506885868

    9/27

    b) Assembly Language : (Symbolic

    Language) Instead of numeric code,

    some symbols are used.

    Examples :

    LOAD BASEPAY

    ADD OVERPAYSTORE GROSSPAY

    Symbols also vary from machine to machine.

  • 8/8/2019 159138_633718968506885868

    10/27

    B) High Level Languages : High Level languages are

    machine independent. These are more near to ourproblems. Easy to learn and with less time. We can

    learn anyone high level language and that will

    work on any computer of any company in any part

    of the world.

  • 8/8/2019 159138_633718968506885868

    11/27

    The various High Level Languages are :-

    BASIC Beginners All Purpose SymbolicInstruction Code

    FORTRAN Formula Translation

    COBOL Common Business Oriented Language PASCAL Named after Blais Pascal

    C The latest and most powerful language.

  • 8/8/2019 159138_633718968506885868

    12/27

    TRANSLATORS

    Actual Processing is done in only in machine

    languages. All Assembly language and High levellanguage programs have to be translated into the

    machine language of that particular machine.

  • 8/8/2019 159138_633718968506885868

    13/27

    Translators are provided by the manufacturers.

    There are three types of translators

    i) Assembler

    ii) Interpreter

    iii) Compiler

    Translator first finds the grammatical mistakes and if

    there is no grammatical mistake then translate it intothe machine language.

  • 8/8/2019 159138_633718968506885868

    14/27

    i) Assembler : Assembler translates only the assemblylanguage program into the machine language.

    ii) Interpreter : Check and translate the high levellanguage programs into the machine language line byline.

    Interpreter is available only for BASIC language

    iii) Compiler : Reads the whole high level program, ifthere is no grammatical error, then it translates thewhole program into the machine language.

  • 8/8/2019 159138_633718968506885868

    15/27

    Source Code : Program written in High-

    level languages.

    Object Code : Translated program in

    machine language fromhigh level languages.

    There are two types of Errors

    i) Syntax Errorsii) Logic Errors

  • 8/8/2019 159138_633718968506885868

    16/27

    Syntax Errors : Every computer language has

    its own grammer and the rules of the language.

    If the program is not according to the rules of

    the language, those errors are called Syntax

    errors (Grammatical Errors). Syntax Errors are

    easy to detect and easy to remove.

  • 8/8/2019 159138_633718968506885868

    17/27

    Logic Errors If there is no Syntax error, still

    program may or may not work. If our method or

    logic is wrong, the program wont work

    (GIGO).

    eg. - Diversion by zero.

    - Square root of negative

    numbers.

    - Number out of range, etc.

  • 8/8/2019 159138_633718968506885868

    18/27

    5.Execution and Results :-

    Object Program + Data ResultsActual processing is done with the object program.

    Any change or correction in the problem, has to be

    made first in the source program, then source

    program is translated into the object program. No

    direct change in the object program.

  • 8/8/2019 159138_633718968506885868

    19/27

    If some logic error is there, you may not get the

    result. You have to first correct logic and thenmake the necessary correction in the source

    program and then translated into the object

    program and finally execution.

  • 8/8/2019 159138_633718968506885868

    20/27

    C) Data Base Languages :

    DBASE-III, IV FOXPRO

    ORACLE

  • 8/8/2019 159138_633718968506885868

    21/27

    Data Base Languages are :

    - Easy to use- Much simpler

    - Popular among non-professional

    - Learning with less time- Language as well as package

  • 8/8/2019 159138_633718968506885868

    22/27

    Language Database languages have all the features ofhigh-level languages.

    Package Database languages have some command to dosome jobs. Commands can be used directly and there is noneed of any programming.

    Other packages are :

    - MS-WORD

    - MS-EXCEL

    - MS-ACCESS

  • 8/8/2019 159138_633718968506885868

    23/27

  • 8/8/2019 159138_633718968506885868

    24/27

    Example Data Base of Students :

    Data Base Structure :

    Field Name TypeW

    idth

    NAME Character 20

    D-O-B Date 8

    Address Character 30

    City Character 15

    PIN Numeric 6

  • 8/8/2019 159138_633718968506885868

    25/27

    Example of Data Base : Student

    NAME D-O-B ADDR ESS CITY PIN

    1. RAM 15/10/93 145/Sec. 15 Chandigarh 160015

    2. SHAM 10/05/92 165/Sec.- 19 Chandigarh 160019

    3. SITA 10/06/93 989/Sec.- 45 Chandigarh 160045

  • 8/8/2019 159138_633718968506885868

    26/27

    Facilities available in Database Languages

    1. Creation of Data Base and Data-Base Structure

    2. Entering the Data Records

    3. Editing the Data Records

    4. Adding New Records5. Deleting Records

    6. Retrieving and Searching the records

    7. Displaying the records

    8. Preparing the reports

    9. Quarries

    10. Sorting etc.

  • 8/8/2019 159138_633718968506885868

    27/27