HSSN Language Translator

Embed Size (px)

Citation preview

  • 8/13/2019 HSSN Language Translator

    1/51

    Hardware and Software Systems and Networks 2CT024-3-2

    Degree : Level-2

    Language Translator

  • 8/13/2019 HSSN Language Translator

    2/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 2

    Objectives

    Differentiate between machine and assembly languages

    Identify and discuss the purpose of procedural programminglanguages

    Discuss the advantages and uses of visual programming languages

    Identify and discuss the characteristics of object-oriented

    programming languages Identify the uses of various nonprocedural languages and tools

    Describe various ways to develop Web pages including HTML,scripting languages, DHTML, XML, WML, and Web page authoringsoftware

    Identify the uses of popular multimedia authoring programs

    List the six steps in the program development cycle Differentiate between structured design and object-oriented design

    Explain the basic control structures used in designing solutions toprogramming problems

  • 8/13/2019 HSSN Language Translator

    3/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 3

    Computer Programs and

    Programming Languages

    What is a computer program? Set of instructions that directs computer to perform

    tasks Programming languageused to write instructions

  • 8/13/2019 HSSN Language Translator

    4/51

  • 8/13/2019 HSSN Language Translator

    5/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 5

    Low-Level LanguagesWhat is machine language?

    Only language computer

    directly recognizes

  • 8/13/2019 HSSN Language Translator

    6/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 6

    Low-Level LanguagesWhat is assembly language? Instructions made up of

    symbolic instruction

    codes, meaningfulabbreviations and codes

    Source programcontains

    code to be converted to

    machine language

  • 8/13/2019 HSSN Language Translator

    7/51CT014-1 Hardware, Systems Software and Networks Chapter 2 7

    Procedural LanguagesWhat is a procedural language?

    Most widely used are BASIC,

    COBOL, and C

    Uses series of English-like

    words to write instructions

    Often called third-generation

    language (3GL)

    Programmer writesinstructions that tell

    computer what to accomplish

    and how to do it

  • 8/13/2019 HSSN Language Translator

    8/51CT014-1 Hardware, Systems Software and Networks Chapter 2 8

    Procedural Languages What is a compiler?

    Program that

    converts entiresource program

    into machine

    language before

    executing it

  • 8/13/2019 HSSN Language Translator

    9/51CT014-1 Hardware, Systems Software and Networks Chapter 2 9

    Procedural LanguagesWhat is an interpreter? Program that

    translates andexecutes one

    program code

    statement at

    a time Does not produce

    object program

  • 8/13/2019 HSSN Language Translator

    10/51CT014-1 Hardware, Systems Software and Networks Chapter 2 10

    Procedural LanguagesWhat is BASIC?

    Designed for use as simple, interactive problem-solving

    language

    Beginners All-purpose Symbolic Instruction Code

  • 8/13/2019 HSSN Language Translator

    11/51CT014-1 Hardware, Systems Software and Networks Chapter 2 11

    Procedural LanguagesWhat is COBOL?

    Designed for business applications

    English-like statements make code easy to read, write,

    and maintain COmmon

    Business-Oriented

    Language

  • 8/13/2019 HSSN Language Translator

    12/51CT014-1 Hardware, Systems Software and Networks Chapter 2 12

    Procedural Languages What is C? Powerful language originally designed to write system

    software

    Requires professional programming skills

  • 8/13/2019 HSSN Language Translator

    13/51CT014-1 Hardware, Systems Software and Networks Chapter 2 13

    Object-Oriented Programming Languages

    What is an object-oriented programming

    (OOP) language?Used to

    implement

    object-oriented

    design

    Major benefitis ability to

    reuse existing

    objects

    Event-drivenchecks for

    and responds

    to set of events

    C++ and Javaare complete

    object-oriented

    languages

    Objectis

    item thatcontains

    data and

    procedures

    that act on

    data

    Eventisaction to

    which

    program

    responds

  • 8/13/2019 HSSN Language Translator

    14/51CT014-1 Hardware, Systems Software and Networks Chapter 2 14

    Object-Oriented Programming Languages

    What is C++? Includes all elements of C, plus additional features

    for working with object-oriented concepts

    Used to develop

    database and

    Web applications

  • 8/13/2019 HSSN Language Translator

    15/51CT014-1 Hardware, Systems Software and Networks Chapter 2 15

    Object-Oriented Programming Languages

    What is Java?

    Developed by Sun

    Microsystem

    Similar to C++ but

    usesjust-in-time (JIT)

    compilerto convert

    source code intomachine code

  • 8/13/2019 HSSN Language Translator

    16/51CT014-1 Hardware, Systems Software and Networks Chapter 2 16

    Object-Oriented Programming Languages

    What is a visual programminglanguage?

    Programmer writes

    and implements

    program in segments

    Visual programming

    environment (VPE)

    allows developers to

    drag and drop objectsto build programs

    Often used in RAD

    (rapid application

    development)

    environment

    Sometimes called

    fifth-generation

    language

    Provides visual or

    graphical interface for

    creating source code

  • 8/13/2019 HSSN Language Translator

    17/51CT014-1 Hardware, Systems Software and Networks Chapter 2

    Object-Oriented Programming Languages

    What is Visual Studio .NET 2003? Suite of visual programming languages and RAD tools .NET is set of technologies that allows program to run on Internet

    Visual Basic .NET 2003is used to build complex object-based programs

    Step 1. Theprogrammer

    designs the

    user interface.

    Step 2.The programmerassigns properties to each

    object on the form.

    Step 4.The programmer

    tests the application.

    Step 3.The

    programmerwrites code

    to define the

    action of each

    command button.

  • 8/13/2019 HSSN Language Translator

    18/51CT014-1 Hardware, Systems Software and Networks Chapter 2 18

    Object-Oriented Programming Languages

    What is Delphi? Powerful visual programming tool

    Ideal for large-scale enterprise and Web applications

  • 8/13/2019 HSSN Language Translator

    19/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 19

    Object-Oriented Programming Languages

    What is PowerBuilder?

    Another powerful visual programming tool

    Best suited for Web-based and large-scale

    object-oriented applications

  • 8/13/2019 HSSN Language Translator

    20/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 20

    Nonprocedural Languages

    and Program Development Tools

    What are nonprocedural languagesand

    program development tools?

    Nonprocedural

    LanguageThe programmer writes English-

    like instructions or interacts with

    a visual environment to retrievedata from files or a database

    Program Development

    ToolsUser-friendly programs

    designed to assist both

    programmers and users increating programs

  • 8/13/2019 HSSN Language Translator

    21/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 21

    Nonprocedural Languages

    and Program Development ToolsWhat is RPG(Report Program

    Generator)? Nonprocedural language used for generating reports,performing computations, and updating files

  • 8/13/2019 HSSN Language Translator

    22/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 22

    Nonprocedural Languages

    and Program Development Tools

    What is a fourth-generation language

    (4GL)? Nonprocedural language that allows access to data indatabase Popular 4GL is SQL, query language that allows users to

    manage data in relational DBMS

  • 8/13/2019 HSSN Language Translator

    23/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 23

    Nonprocedural Languages

    and Program Development Tools

    What is an application generator? Program that creates source code or machine code from

    specification

    Consists of report writer, form, and menu generator

    Formprovides areas for entering data

  • 8/13/2019 HSSN Language Translator

    24/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 24

    Nonprocedural Languages

    and Program Development Tools

    What is Visual Basic for Applications

    (VBA)? Macro programming language Macroseries of statements used to automate tasks

  • 8/13/2019 HSSN Language Translator

    25/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 25

    Web Page DevelopmentWhat is HTML (Hypertext Markup Language)? Used to create Web pages

  • 8/13/2019 HSSN Language Translator

    26/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 26

    Web Page DevelopmentHow are special effects and interactive elementsadded to a Web page?

    Countertracks

    number of

    visitors to

    Web site

    Image mapgraphic

    image that

    points to

    URL

    Scriptinterpreted

    program that

    runs on client

    Appletusually runs

    on client, but

    is compiled

    Processingform

    collects data

    from visitors

    to Web site

    Servletapplet that

    runs on

    server

    ActiveX

    control

    small program

    that runs on

    client

  • 8/13/2019 HSSN Language Translator

    27/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 27

    Web Page DevelopmentWhat is the common gateway interface (CGI)? Communications standard that defines how Web server

    communicates with outside sources

    Step 3. When the user submits arequest, it is sent to the CGI program.The CGI program contacts the

    database and requests information for

    the user. In this case, it looks for a

    movie titled The Wizard of Oz.

    Step 1. Theprogrammer stores

    the CGI program in

    a special folder on

    the Web server such

    as /cgi-bin.

    Database

    CGI scriptprogramthat manages sending and receiving across CGI

    Step 2. The Webmaster creates alink between the CGI program andWeb page. When a user displays the

    Web page, the CGI program

    automatically starts.

    Step 4. The CGIprogram receives

    information from the

    database, assembles

    it in an HTML

    format, and sends it

    to the users Web

    browser.

  • 8/13/2019 HSSN Language Translator

    28/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 28

    Web Page DevelopmentWhat is a scripting language? Typically easy to learn and use

    JavaScriptadds

    dynamic content and

    interactive elements to

    Web page

    VBScript (Visual Basic,

    Scripting Edition)adds

    intelligence and

    interactivity to Web page

    Perl (Practical Extractionand Report Language)

    has powerful text

    processing capabilities

  • 8/13/2019 HSSN Language Translator

    29/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 29

    Web Page DevelopmentWhat is dynamic HTML (DHTML)?

    Allows developers to

    include more graphical

    interest and interactivity

    in Web page

  • 8/13/2019 HSSN Language Translator

    30/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 30

    Web Page DevelopmentWhat are XHTML, XML, and WML?

    XHTML

    (ExtensibleHTML)enables Web sites to be displayed

    more easily on microbrowsers

    XML

    (ExtensibleMarkupLanguage)allows developers to

    create customized tags

    WML

    (WirelessMarkupLanguage)allows developers to design pages

    specifically for microbrowsers

    Includes features of HTML

    and XML

    Uses wireless

    application protocol (WAP),

    standard that specifies

    how wireless devices

    communicate with Web

    Server sends entire record to

    client, enabling client to do

    much of processing without

    going back to server

  • 8/13/2019 HSSN Language Translator

    31/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 31

    FrontPage

    2003

    Flash

    MX

    Web Page DevelopmentWhat is Web page authoring software?

    Creates sophisticated Web pages without using HTML Generates HTML

    Dreamweaver

    MX

  • 8/13/2019 HSSN Language Translator

    32/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 32

    Multimedia Program

    DevelopmentWhat is multimedia authoring software?

    Combines text,

    graphics, animation,

    audio, and video intointeractive presentation Used for computer-

    based training (CBT)

    and Web-based training

    (WBT)

    Software includes

    Toolbook, Authorware,

    and Director

  • 8/13/2019 HSSN Language Translator

    33/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 33

    Other Programming LanguagesWhat are other available programming

    languages?

    ALGOLADA APL

    FORTH LISPHYPERTALKFORTRAN

    LOGO PASCALMODULA-2

    PILOT SMALLTALKPROLOGPL/I

  • 8/13/2019 HSSN Language Translator

    34/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 34

    The Program Development CycleWhat is the program development cycle?

    Steps programmers use to build computer programs

    Programming

    teamGroupof

    programmersworking on

    program

  • 8/13/2019 HSSN Language Translator

    35/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 35

    Step 1 Analyze RequirementsWhat is involved in analyzing the

    requirements?1. Review requirements2. Meet with systems analyst and users3. Identify input, output, processing, and data

    components

    IPO chart

    Identifies

    programs inputs,outputs, and

    processing steps

  • 8/13/2019 HSSN Language Translator

    36/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 36

    Programmer

    begins with general

    design and moves toward

    detailed design

    Step 2 Design SolutionWhat is involved in designing the solution?

    Object-oriented

    design

    Structured

    design, sometimes

    called top-down design

    Two

    approaches

    Devise

    solution

    algorithm,

    step-by-stepprocedure to

    solve problem

  • 8/13/2019 HSSN Language Translator

    37/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 37

    Step 2 Design SolutionWhat is a hierarchy chart? Shows program modules graphically Also called structure chart

  • 8/13/2019 HSSN Language Translator

    38/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 38

    Step 2 Design Solution What is object-oriented (OO) design? Programmer packages data and

    procedure into single unit, an object Objects are grouped into classes Class diagramrepresents hierarchical

    relationships of classes graphically

  • 8/13/2019 HSSN Language Translator

    39/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 39

    Step 2 Design Solution What is a sequence control structure? Control structure that shows actions following each

    other in order

    Control structuredepicts logical order of programinstructions

  • 8/13/2019 HSSN Language Translator

    40/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 40

    Step 2 Design SolutionWhat is a selection control structure?

    Tells program which

    action to take, based

    on a certaincondition

    Two types Case control structure

    If-then-else controlstructureyieldsone

    of two possibilities:

    true or false

  • 8/13/2019 HSSN Language Translator

    41/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 41

    Step 2 Design SolutionWhat is a case control structure? Yields one of three or more possibilities

  • 8/13/2019 HSSN Language Translator

    42/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 42

    Step 2 Design Solution

    What is a repetition control structure? Enables program to perform one or more actions

    repeatedly

    Do-while controlstructurerepeatsas

    long as condition is

    true

    Do-until control

    structurerepeatsuntil condition is true

    Do-While Control Structure Do-Until Control Structure

  • 8/13/2019 HSSN Language Translator

    43/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 43

    Step 2 Design Solution What is aprogram flowchart? Graphically shows logic

    in solution algorithm

  • 8/13/2019 HSSN Language Translator

    44/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 44

    Step 2 Design SolutionWhat is an example of a flowchart?

  • 8/13/2019 HSSN Language Translator

    45/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 45

    Step 2 Design Solution

    What is flowcharting software? Used by programmers to develop flowcharts

  • 8/13/2019 HSSN Language Translator

    46/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 46

    Step 2 Design SolutionWhat is pseudocode?

    Uses condensed form

    of English to convey

    program logic

  • 8/13/2019 HSSN Language Translator

    47/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 47

    Step 3 Validate DesignWhat is involved in validating the design?

    Check program

    design for accuracy

    Logic error

    design flaw

    that causes

    inaccurate results

    Test data

    sample data that

    mimics real data that

    program will process

    Programmer checkslogic for correctness

    and attempts to uncoverlogic errors

    Desk checkprogrammers use test

    data to step through logicStructured walkthrough

    programmer explains

    logic of algorithm while

    programming team steps

    through program logic

  • 8/13/2019 HSSN Language Translator

    48/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 48

    Step 4 Implement Design What is implementation? Writing the code that translates the design into a program

    Syntaxrules that specify how to write instructions

    Commentsprogramdocumentation

    Extreme programming (XP)coding and testing as soon as

    requirements are defined

  • 8/13/2019 HSSN Language Translator

    49/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 49

    Step 5 Test SolutionWhat is involved in testing the solution?

    Ensure program runs correctlyand is error free

    Debugginglocating and

    correcting syntax and logicerrors, orbugs

    Test copy of program,

    called beta, sometimes

    used to find bugs

  • 8/13/2019 HSSN Language Translator

    50/51

    CT014-1 Hardware, Systems Software and Networks Chapter 2 50

    Step 6 Document SolutionWhat is involved in documenting the

    solution? Programmer performs two activitiesReviews program

    coderemoves dead

    code, program

    instructions that

    program never executes

    Reviews

    documentation

    S f L

  • 8/13/2019 HSSN Language Translator

    51/51

    Summary of Language

    Translators

    Various programming languages

    used to write and develop computer

    programs The program development cycle and

    the tools used to make this process

    efficient Web development and multimedia

    development tools