SlideShare a Scribd company logo
1 of 18
Definition of programming language.

 A programming language is a set of
 words, symbols and codes that
 enables humans to communicate with
 computers. It is a language used for
 writing computer programs, that
 direct a computer to perform
 computation and to organise the flow
 of control between mechanical
 devices.
The generations of low-level programming languages with examples.

FIRST GENERATION OF PROGRAMMING LANGUAGE
 The first generation of programming language, or 1GL, is machine language. Machine
   language is a set of instructions and data that a computer's central processing unit can
   execute directly. Machine language statements are written in binary code, and each
   statement corresponds to one machine action.

SECOND GENERATION PROGRAMMING LANGUAGE
 The second generation programming language, or 2GL, is assembly language. Assembly
  language is the human-readable notation for the machine language used to control specific
  computer operations. An assembly language programmer writes instructions using symbolic
  instruction codes that are meaningful abbreviations or mnemonics. An assembler is a
  program that translates assembly language into machine language. Since assembly language
  consist of human-readable abbreviations, the assembler must first convert assembly language
  into machine-readable language before the computer can readily understand its instructions.

The generations of high-level programming languages with examples.
THIRD GENERATION PROGRAMMING LANGUAGE
 The third generation of programming language, 3GL, or procedural language uses a series of
  English-like words, that are closer to human language, to write instructions. High-level
  programming languages make complex programming simpler and easier to read, write and
  maintain. Programs written in a high-level programming language must be translated into
  machine language by a compiler or interpreter. PASCAL, FORTRAN, BASIC, COBOL, C
  and C++ are examples of third generation programming languages.
FOURTH GENERATION PROGRAMMING LANGUAGE
  - The fourth generation programming language or non-procedural
  language, often abbreviated as 4GL, enables users to access data in a database.
  A very high-level programming language is often referred to as goal-oriented
  programming language because it is usually limited to a very specific application
  and it might use syntax that is never used in other programming languages.
  SQL, NOMAD and FOCUS are examples of fourth generation programming
  languages.

  FIFTH GENERATION PROGRAMMING LANGUAGE
   - The fifth generation programming language or visual programming language, is
  also known as natural language. Provides a visual or graphical interface, called a
  visual programming environment, for creating source codes. Fifth generation
  programming allows people to interact with computers without needing any
  specialised knowledge. People can talk to computers and the voice recognition
  systems can convert spoken sounds into written words, but these systems do not
  understand what they are writing; they simply take dictation. Prolog and
  Mercury are the best known fifth-generation languages.
STRUCTURED PROGRAMMING EDUCATION

•Structured programming often uses a top-down design model where developers map out
the overall program structure into separate subsections from top to bottom.

•In the top-down design model, programs are drawn as rectangles. A top-down design means
that the whole program is broken down into smaller sections that are known as modules. A
program may have a module or several modules.

•Structured programming is beneficial for organising and coding computer programs which
employ a hierarchy of modules. This means that control is passed downwards only through
the hierarchy.

•Examples of structured programming languages include Ada, Pascal and Fortran.




DEFINE OBJECT-ORIENTED APPROACH IN PROGRAMMING.
 The object-oriented approach refers to a special type of programming approach that
  combines data with functions to create objects. In an object-oriented program, the
  object have relationships with one another. One of the earliest OOP languages is
  Smalltalk. Java, Visual Basic and C++ are examples of popular OOP languages.
Differentiate between structured approach and object-
oriented approach in programming
Structured approach      differences    Object-oriented
                                        approach


Structured programming   Uses           Object oriented approach
approached uses a top                   uses objects.
down design model.
The programmer divides   Emphasize      The programmer
programming problem                     packages the data and the
into module like                        function into a single
function.                               unit, an object.
Medium programming       Suitable for   Large programming
project.                                project.
Describe the translation method of
           programming using
    assembler, interpreter and compiler.
                                                                      COMPILER
                                     INTERPRETER

                                                                The source code (in text
                                 Interpreter is used to
                                                              format) will be converted
                                 interpret and execute
                                                             into machine code which is a
       ASSEMBLER              program directly from its
                                                               file consisting of binary
                             source without compiling it
An assembler is a computer                                     machine code that can be
                              first. The source code of an
 program for translating                                      executed on a computer. If
                                interpreted language is
    assembly language —                                      the compiler encounters any
                             interpreted and executed in
  essentially, a mnemonic                                     errors, it records them in
                                real time when the user
representation of machine                                      the program-listing file.
                                        execute it.
  language — into machine                                  When a user wants to run the
         language.            The interpreter will read
                                                                program, the object
                               each codes converts it to
                                                            program is loaded into the
                             machine code and executes it
                                                           memory of the computer and
                             line by line until the end of
                                                             the program instructions
                              the program. Examples of
                                                            begin executing. A compiled
                             interpreter-based language
                                                            code generally runs faster
                                  are BASIC, Logo and
                                                              than programs based on
                                      Smalltalk.
                                                               interpreted language.
Interpreter                Difference     Compiler



Translate programming      Method         Translate entire
statement line by line and                programming statement
execute it immediately.                   and execute it later.
No object code is saved.   Object code    Store machine language
                                          as object code on the disk.


Interpreted code run       Running time   Compiled code run faster.
slower.
Basic elements in programming
 Constant declaration         Constants      Differences      Variables

  const costantName = value
                               Constants      characteristic   Variables can
  e.g : const PI = 3.142       retain their   s                change their
         const gravity = 9.8   value during                    value during
         const discount = 0.2 the program                      program
                               execution.                      execution.
 Variable declaration
  Dim variableName as datatype
  e.g : dim studentName as string
         dim noOfStudent as integer
         dim schoolFee as double
         dim DateOfBirth as date
Integer
                                             Double

Integer data type contains any
                                 Any number value that may and
whole number value that does
                                 could contain a fractional part.
 not have any fractional part.


                          Differentiate
                        between the data
                              types


                                             Boolean
           String

                                   Boolean type consists either a
  Any value that contains a
                                 True or False value. Programmers
   sequence of characters.
                                   usually use it to store status.
Differentiate between mathematical and logical
operators
 Operator is a symbol or notation that tells a computer to perform
  certain actions or operations.
    Mathematical Meaning
                                       Logical              Meaning
    operator
                                       operator
    +               Plus
                                       And                  And operator
    -               Minus
                                       Or                   Or operator
    *               Multiply
    /               divide             Not                  Not operator

           Comparison operator         Meaning
           >                           Greater than
           <                           Less than
           =                           Equal
           <>                          Not
           <=                          Less than or equal
 Five main elements in a flow chart
Symbols         Names               Explanation

                Terminal begin or   Use to shows the beginning or end of
                end                 a program.

                Flowlines           Use to connect symbols and indicate
                                    the sequences of operation.

                Input or output     Use to shows either an input
                (print / display)   operations(e.g. an input from the
                                    user) or an output operation(e.g.
                                    print or display messages)
                Process             Use to shows a process to be carried
                (formula)           out (e.g. calculator

                Decision            Use to shows a decision(or choice) to
                (if-then-else)      be made. The program should
                                    continue along one of two routes(e.g.
                                    if…then…else)
 Draw a flowchart to show how a program calculates
 the area of a circle.

                            Begin



                          Get radius



                         Area of ciccle
                          = ½ * PI *
                           radius^2



                          Print area
                           of circle


                              End
Five main phases in program development:


Phase                     Explanation

Problem analysis           Identify input, processing, output and data component.
                           Meet with system analyst and users.
                           Ask expert.
Program design             Divide all program activities into program modules.
                           Create solution algorithm for each program modules(logic
                            structure).
                           Design/ draw user interface.

Coding                     Coding a program involves translating the solution algorithm
(writing the program is     into programming language usually on paper.
    called coding)         Typing code into the computer using programming language.
Testing and debugging      Manually testing with sample data.
                           The program is run through computer, using a translator
                            program. Before the program will run, it must be free of syntax
                            error.
Documentation              Documentation enables new programmer to understand the
                            flow of program
                           Is used for future reference in case the program needs change.
                           Explain the purpose of the code statement.
Types of error
1.   Syntax error
     caused by wrong spelling in commands(words) and declaration. Other
     syntax error include case sensitive and wrong words command.
     the easiest error to find because they are highlighted by the compiler. Error
     message are given.
     example :


        Source code                         Syntax error : missing curly
                                            braces }
        If (mark > 50)                      If (mark > 50)
        {                                   {

        Else                                }
        {                                   Else
                                            {
        }
                                            }
latest programming languages:




                                  Fifth generation language
               Fifth generation programming language (5GL) is an advance
                   programming language which concentrates on solving
                      problems using constraints given to the program.
                 In fifth generation language, the programmer just need to
                    define the problem to be solve and the program will
                   automatically code the program based on the problem
              definition.Fifth generation languages are designed to make the
                 computer solve the problem for you. These languages are
                mostly used in artificial intelligence research. Examples of
                  fifth generation languages include Prolog and Mercury.
openGL (graphic library)
 OpenGL is a standard specification to describe the standard Application
Programming Interface (API) for 3D/2D computer graphic applications. It’s
specification describes a set of functions and the exact behaviours that the
                     3D/2D application must perform.
  OpenGL was developed by Silicon Graphics. OpenGL is widely used in
  virtual reality, scientific visualisation, flight simulation and video game
                                   development




                                                       Natural language
                                Natural Language programming aims to use natural language
                                            such as English to write a program.
                                     Instead of using a specific programming language
                                   syntax, natural language programming will use normal
                                 English as the input to program software. Such a technique
                                   would mean less technical programming knowledge is
                                required to write a program.The programmer needs to define
                                             the program using normal language.
End chapter 5…….

More Related Content

What's hot

Lesson 5 computer software
Lesson 5 computer softwareLesson 5 computer software
Lesson 5 computer softwareVishal Patyal
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)Vaibhav Bajaj
 
Presentation on Operating System & its Components
Presentation on Operating System & its ComponentsPresentation on Operating System & its Components
Presentation on Operating System & its ComponentsMahmuda Rahman
 
Introduction to Operating Systems
Introduction to Operating SystemsIntroduction to Operating Systems
Introduction to Operating SystemsMukesh Chinta
 
Language processor
Language processorLanguage processor
Language processorAbha Damani
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingNSU-Biliran Campus
 
Basic programming concepts
Basic programming conceptsBasic programming concepts
Basic programming conceptssalmankhan570
 
What is software
What is softwareWhat is software
What is softwareAnil815218
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
 
Parts Of A Computer by Meryll Grace D. Samson of I-Fortitude
Parts Of A Computer by Meryll Grace D. Samson of I-FortitudeParts Of A Computer by Meryll Grace D. Samson of I-Fortitude
Parts Of A Computer by Meryll Grace D. Samson of I-FortitudeMeryllGrace143
 
Booting Process OS
Booting Process OSBooting Process OS
Booting Process OSanilinvns
 
Operating System - Microsoft Windows 10
Operating System - Microsoft Windows 10 Operating System - Microsoft Windows 10
Operating System - Microsoft Windows 10 Ruchika Sawant
 

What's hot (20)

Lesson 5 computer software
Lesson 5 computer softwareLesson 5 computer software
Lesson 5 computer software
 
Shell programming
Shell programmingShell programming
Shell programming
 
Operating system.ppt (1)
Operating system.ppt (1)Operating system.ppt (1)
Operating system.ppt (1)
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Operating system
Operating systemOperating system
Operating system
 
Presentation on Operating System & its Components
Presentation on Operating System & its ComponentsPresentation on Operating System & its Components
Presentation on Operating System & its Components
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Introduction to Operating Systems
Introduction to Operating SystemsIntroduction to Operating Systems
Introduction to Operating Systems
 
Introduction to Operating Systems
Introduction to Operating SystemsIntroduction to Operating Systems
Introduction to Operating Systems
 
Language processor
Language processorLanguage processor
Language processor
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
System software vs application software
System software vs application softwareSystem software vs application software
System software vs application software
 
Basic programming concepts
Basic programming conceptsBasic programming concepts
Basic programming concepts
 
MS Dos command
MS Dos commandMS Dos command
MS Dos command
 
What is software
What is softwareWhat is software
What is software
 
Computer programming concepts
Computer programming conceptsComputer programming concepts
Computer programming concepts
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Parts Of A Computer by Meryll Grace D. Samson of I-Fortitude
Parts Of A Computer by Meryll Grace D. Samson of I-FortitudeParts Of A Computer by Meryll Grace D. Samson of I-Fortitude
Parts Of A Computer by Meryll Grace D. Samson of I-Fortitude
 
Booting Process OS
Booting Process OSBooting Process OS
Booting Process OS
 
Operating System - Microsoft Windows 10
Operating System - Microsoft Windows 10 Operating System - Microsoft Windows 10
Operating System - Microsoft Windows 10
 

Viewers also liked

La5 ict-topic-5-programming
La5 ict-topic-5-programmingLa5 ict-topic-5-programming
La5 ict-topic-5-programmingKak Yong
 
18 EXAMPLES of IMMERSIVE MULTIMEDIA
18 EXAMPLES of IMMERSIVE MULTIMEDIA18 EXAMPLES of IMMERSIVE MULTIMEDIA
18 EXAMPLES of IMMERSIVE MULTIMEDIAFarid Diah
 
ICT, Importance of programming and programming languages
ICT, Importance of programming and programming languagesICT, Importance of programming and programming languages
ICT, Importance of programming and programming languagesEbin Robinson
 
Bidang pembelajaran 5.1 Tingkatan 5
Bidang pembelajaran 5.1 Tingkatan 5Bidang pembelajaran 5.1 Tingkatan 5
Bidang pembelajaran 5.1 Tingkatan 5MOE
 
Nota Padat ICT SPM
Nota Padat ICT SPMNota Padat ICT SPM
Nota Padat ICT SPMD.J Md Thani
 
Bidang pembelajaran 5.2 Tingkatan 5
Bidang pembelajaran 5.2 Tingkatan 5Bidang pembelajaran 5.2 Tingkatan 5
Bidang pembelajaran 5.2 Tingkatan 5MOE
 
Immersive Multimedia (PowerPoint)
Immersive Multimedia (PowerPoint)Immersive Multimedia (PowerPoint)
Immersive Multimedia (PowerPoint)Blog
 
Bidang pembelajaran 5.3 Tingkatan 5
Bidang pembelajaran 5.3 Tingkatan 5Bidang pembelajaran 5.3 Tingkatan 5
Bidang pembelajaran 5.3 Tingkatan 5MOE
 
5.1 konsep asas pengaturcaraan
5.1 konsep asas pengaturcaraan5.1 konsep asas pengaturcaraan
5.1 konsep asas pengaturcaraandean36
 
Programming languages
Programming languagesProgramming languages
Programming languagesAkash Varaiya
 
Spm physics-formula-list-form5
Spm physics-formula-list-form5Spm physics-formula-list-form5
Spm physics-formula-list-form5Nor Zawani Halim
 
5.1.5 elemen asas dlm pengaturcaraan
5.1.5  elemen asas  dlm pengaturcaraan5.1.5  elemen asas  dlm pengaturcaraan
5.1.5 elemen asas dlm pengaturcaraandean36
 
Chapter 2 computer system
Chapter 2 computer systemChapter 2 computer system
Chapter 2 computer systemAten Kecik
 
Bidang pembelajaran 4.3 Tingkatan 5
Bidang pembelajaran  4.3 Tingkatan 5Bidang pembelajaran  4.3 Tingkatan 5
Bidang pembelajaran 4.3 Tingkatan 5MOE
 
Bidang pembelajaran 4.1 Tingkatan 5
Bidang pembelajaran 4.1 Tingkatan 5Bidang pembelajaran 4.1 Tingkatan 5
Bidang pembelajaran 4.1 Tingkatan 5MOE
 
Bidang pembelajaran 4.2 Tingkatan 5
Bidang pembelajaran 4.2 Tingkatan 5Bidang pembelajaran 4.2 Tingkatan 5
Bidang pembelajaran 4.2 Tingkatan 5MOE
 
Computer Languages....ppt
Computer Languages....pptComputer Languages....ppt
Computer Languages....ppthashgeneration
 

Viewers also liked (20)

La5 ict-topic-5-programming
La5 ict-topic-5-programmingLa5 ict-topic-5-programming
La5 ict-topic-5-programming
 
18 EXAMPLES of IMMERSIVE MULTIMEDIA
18 EXAMPLES of IMMERSIVE MULTIMEDIA18 EXAMPLES of IMMERSIVE MULTIMEDIA
18 EXAMPLES of IMMERSIVE MULTIMEDIA
 
ICT, Importance of programming and programming languages
ICT, Importance of programming and programming languagesICT, Importance of programming and programming languages
ICT, Importance of programming and programming languages
 
Bidang pembelajaran 5.1 Tingkatan 5
Bidang pembelajaran 5.1 Tingkatan 5Bidang pembelajaran 5.1 Tingkatan 5
Bidang pembelajaran 5.1 Tingkatan 5
 
Nota Padat ICT SPM
Nota Padat ICT SPMNota Padat ICT SPM
Nota Padat ICT SPM
 
Bidang pembelajaran 5.2 Tingkatan 5
Bidang pembelajaran 5.2 Tingkatan 5Bidang pembelajaran 5.2 Tingkatan 5
Bidang pembelajaran 5.2 Tingkatan 5
 
Immersive Multimedia (PowerPoint)
Immersive Multimedia (PowerPoint)Immersive Multimedia (PowerPoint)
Immersive Multimedia (PowerPoint)
 
Bidang pembelajaran 5.3 Tingkatan 5
Bidang pembelajaran 5.3 Tingkatan 5Bidang pembelajaran 5.3 Tingkatan 5
Bidang pembelajaran 5.3 Tingkatan 5
 
5.1 konsep asas pengaturcaraan
5.1 konsep asas pengaturcaraan5.1 konsep asas pengaturcaraan
5.1 konsep asas pengaturcaraan
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Spm physics-formula-list-form5
Spm physics-formula-list-form5Spm physics-formula-list-form5
Spm physics-formula-list-form5
 
5.1.5 elemen asas dlm pengaturcaraan
5.1.5  elemen asas  dlm pengaturcaraan5.1.5  elemen asas  dlm pengaturcaraan
5.1.5 elemen asas dlm pengaturcaraan
 
Chapter 2 computer system
Chapter 2 computer systemChapter 2 computer system
Chapter 2 computer system
 
Bidang pembelajaran 4.3 Tingkatan 5
Bidang pembelajaran  4.3 Tingkatan 5Bidang pembelajaran  4.3 Tingkatan 5
Bidang pembelajaran 4.3 Tingkatan 5
 
Bidang pembelajaran 4.1 Tingkatan 5
Bidang pembelajaran 4.1 Tingkatan 5Bidang pembelajaran 4.1 Tingkatan 5
Bidang pembelajaran 4.1 Tingkatan 5
 
Bidang pembelajaran 4.2 Tingkatan 5
Bidang pembelajaran 4.2 Tingkatan 5Bidang pembelajaran 4.2 Tingkatan 5
Bidang pembelajaran 4.2 Tingkatan 5
 
Computer languages 11
Computer languages 11Computer languages 11
Computer languages 11
 
Computer Languages....ppt
Computer Languages....pptComputer Languages....ppt
Computer Languages....ppt
 
Computer Languages.
Computer Languages.Computer Languages.
Computer Languages.
 
Computer languages
Computer languagesComputer languages
Computer languages
 

Similar to Chapter 5-programming

Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution pptKeerty Smile
 
2 Programming Language.pdf
2 Programming Language.pdf2 Programming Language.pdf
2 Programming Language.pdfKINGZzofYouTube
 
La 5 Pl Translator
La 5   Pl TranslatorLa 5   Pl Translator
La 5 Pl TranslatorCma Mohd
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSsonalikharade3
 
Compiler design slide share
Compiler design slide shareCompiler design slide share
Compiler design slide shareSudhaa Ravi
 
Chapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxChapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxdawod yimer
 
Introduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem AnsariIntroduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem AnsariTech
 
Computer programming
Computer programmingComputer programming
Computer programmingSuneel Dogra
 
Form5 cd1
Form5 cd1Form5 cd1
Form5 cd1smktsj2
 
La5 ict-topic-5-programming
La5 ict-topic-5-programmingLa5 ict-topic-5-programming
La5 ict-topic-5-programmingAzmiah Mahmud
 

Similar to Chapter 5-programming (20)

Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Insight into progam execution ppt
Insight into progam execution pptInsight into progam execution ppt
Insight into progam execution ppt
 
SYSTEM DEVELOPMENT
SYSTEM DEVELOPMENTSYSTEM DEVELOPMENT
SYSTEM DEVELOPMENT
 
2 Programming Language.pdf
2 Programming Language.pdf2 Programming Language.pdf
2 Programming Language.pdf
 
La 5 Pl Translator
La 5   Pl TranslatorLa 5   Pl Translator
La 5 Pl Translator
 
Chapter 5
Chapter 5Chapter 5
Chapter 5
 
Notacd07
Notacd07Notacd07
Notacd07
 
Nota programming
Nota programmingNota programming
Nota programming
 
Programming Part 01
Programming Part 01Programming Part 01
Programming Part 01
 
Notacd071
Notacd071Notacd071
Notacd071
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
 
Compiler design slide share
Compiler design slide shareCompiler design slide share
Compiler design slide share
 
Ict topic 5
Ict topic 5Ict topic 5
Ict topic 5
 
Chapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptxChapter 2 Program language translation.pptx
Chapter 2 Program language translation.pptx
 
Introduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem AnsariIntroduction to Programming Concepts By Aamir Saleem Ansari
Introduction to Programming Concepts By Aamir Saleem Ansari
 
df
dfdf
df
 
Computer programming
Computer programmingComputer programming
Computer programming
 
Form5 cd1
Form5 cd1Form5 cd1
Form5 cd1
 
La5 ict-topic-5-programming
La5 ict-topic-5-programmingLa5 ict-topic-5-programming
La5 ict-topic-5-programming
 
COMPILER DESIGN.docx
COMPILER DESIGN.docxCOMPILER DESIGN.docx
COMPILER DESIGN.docx
 

More from Aten Kecik

Question chapter 1
Question chapter 1Question chapter 1
Question chapter 1Aten Kecik
 
Question chapter 4
Question chapter 4Question chapter 4
Question chapter 4Aten Kecik
 
Soalan chapter 2
Soalan chapter 2Soalan chapter 2
Soalan chapter 2Aten Kecik
 
Soalan chapter 5
Soalan chapter 5Soalan chapter 5
Soalan chapter 5Aten Kecik
 
2.latihan pepejal
2.latihan pepejal2.latihan pepejal
2.latihan pepejalAten Kecik
 
1.latihan wang
1.latihan wang1.latihan wang
1.latihan wangAten Kecik
 
2.nota pepejal
2.nota pepejal2.nota pepejal
2.nota pepejalAten Kecik
 
Chapter 1-introduction to ict
Chapter 1-introduction to ictChapter 1-introduction to ict
Chapter 1-introduction to ictAten Kecik
 
Chapter 6-information system
Chapter 6-information systemChapter 6-information system
Chapter 6-information systemAten Kecik
 
Chapter 4-multimedia
Chapter 4-multimediaChapter 4-multimedia
Chapter 4-multimediaAten Kecik
 
Bab3-computer network
Bab3-computer networkBab3-computer network
Bab3-computer networkAten Kecik
 

More from Aten Kecik (14)

Soalan bab 6
Soalan bab 6Soalan bab 6
Soalan bab 6
 
Soalan bab 3
Soalan bab 3Soalan bab 3
Soalan bab 3
 
Question chapter 1
Question chapter 1Question chapter 1
Question chapter 1
 
Question chapter 4
Question chapter 4Question chapter 4
Question chapter 4
 
Soalan chapter 2
Soalan chapter 2Soalan chapter 2
Soalan chapter 2
 
Soalan chapter 5
Soalan chapter 5Soalan chapter 5
Soalan chapter 5
 
2.latihan pepejal
2.latihan pepejal2.latihan pepejal
2.latihan pepejal
 
1.latihan wang
1.latihan wang1.latihan wang
1.latihan wang
 
1.nota wang
1.nota wang1.nota wang
1.nota wang
 
2.nota pepejal
2.nota pepejal2.nota pepejal
2.nota pepejal
 
Chapter 1-introduction to ict
Chapter 1-introduction to ictChapter 1-introduction to ict
Chapter 1-introduction to ict
 
Chapter 6-information system
Chapter 6-information systemChapter 6-information system
Chapter 6-information system
 
Chapter 4-multimedia
Chapter 4-multimediaChapter 4-multimedia
Chapter 4-multimedia
 
Bab3-computer network
Bab3-computer networkBab3-computer network
Bab3-computer network
 

Chapter 5-programming

  • 1.
  • 2. Definition of programming language.  A programming language is a set of words, symbols and codes that enables humans to communicate with computers. It is a language used for writing computer programs, that direct a computer to perform computation and to organise the flow of control between mechanical devices.
  • 3. The generations of low-level programming languages with examples. FIRST GENERATION OF PROGRAMMING LANGUAGE  The first generation of programming language, or 1GL, is machine language. Machine language is a set of instructions and data that a computer's central processing unit can execute directly. Machine language statements are written in binary code, and each statement corresponds to one machine action. SECOND GENERATION PROGRAMMING LANGUAGE  The second generation programming language, or 2GL, is assembly language. Assembly language is the human-readable notation for the machine language used to control specific computer operations. An assembly language programmer writes instructions using symbolic instruction codes that are meaningful abbreviations or mnemonics. An assembler is a program that translates assembly language into machine language. Since assembly language consist of human-readable abbreviations, the assembler must first convert assembly language into machine-readable language before the computer can readily understand its instructions. The generations of high-level programming languages with examples. THIRD GENERATION PROGRAMMING LANGUAGE  The third generation of programming language, 3GL, or procedural language uses a series of English-like words, that are closer to human language, to write instructions. High-level programming languages make complex programming simpler and easier to read, write and maintain. Programs written in a high-level programming language must be translated into machine language by a compiler or interpreter. PASCAL, FORTRAN, BASIC, COBOL, C and C++ are examples of third generation programming languages.
  • 4. FOURTH GENERATION PROGRAMMING LANGUAGE - The fourth generation programming language or non-procedural language, often abbreviated as 4GL, enables users to access data in a database. A very high-level programming language is often referred to as goal-oriented programming language because it is usually limited to a very specific application and it might use syntax that is never used in other programming languages. SQL, NOMAD and FOCUS are examples of fourth generation programming languages. FIFTH GENERATION PROGRAMMING LANGUAGE - The fifth generation programming language or visual programming language, is also known as natural language. Provides a visual or graphical interface, called a visual programming environment, for creating source codes. Fifth generation programming allows people to interact with computers without needing any specialised knowledge. People can talk to computers and the voice recognition systems can convert spoken sounds into written words, but these systems do not understand what they are writing; they simply take dictation. Prolog and Mercury are the best known fifth-generation languages.
  • 5. STRUCTURED PROGRAMMING EDUCATION •Structured programming often uses a top-down design model where developers map out the overall program structure into separate subsections from top to bottom. •In the top-down design model, programs are drawn as rectangles. A top-down design means that the whole program is broken down into smaller sections that are known as modules. A program may have a module or several modules. •Structured programming is beneficial for organising and coding computer programs which employ a hierarchy of modules. This means that control is passed downwards only through the hierarchy. •Examples of structured programming languages include Ada, Pascal and Fortran. DEFINE OBJECT-ORIENTED APPROACH IN PROGRAMMING.  The object-oriented approach refers to a special type of programming approach that combines data with functions to create objects. In an object-oriented program, the object have relationships with one another. One of the earliest OOP languages is Smalltalk. Java, Visual Basic and C++ are examples of popular OOP languages.
  • 6. Differentiate between structured approach and object- oriented approach in programming Structured approach differences Object-oriented approach Structured programming Uses Object oriented approach approached uses a top uses objects. down design model. The programmer divides Emphasize The programmer programming problem packages the data and the into module like function into a single function. unit, an object. Medium programming Suitable for Large programming project. project.
  • 7. Describe the translation method of programming using assembler, interpreter and compiler. COMPILER INTERPRETER The source code (in text Interpreter is used to format) will be converted interpret and execute into machine code which is a ASSEMBLER program directly from its file consisting of binary source without compiling it An assembler is a computer machine code that can be first. The source code of an program for translating executed on a computer. If interpreted language is assembly language — the compiler encounters any interpreted and executed in essentially, a mnemonic errors, it records them in real time when the user representation of machine the program-listing file. execute it. language — into machine When a user wants to run the language. The interpreter will read program, the object each codes converts it to program is loaded into the machine code and executes it memory of the computer and line by line until the end of the program instructions the program. Examples of begin executing. A compiled interpreter-based language code generally runs faster are BASIC, Logo and than programs based on Smalltalk. interpreted language.
  • 8. Interpreter Difference Compiler Translate programming Method Translate entire statement line by line and programming statement execute it immediately. and execute it later. No object code is saved. Object code Store machine language as object code on the disk. Interpreted code run Running time Compiled code run faster. slower.
  • 9. Basic elements in programming  Constant declaration Constants Differences Variables const costantName = value Constants characteristic Variables can e.g : const PI = 3.142 retain their s change their const gravity = 9.8 value during value during const discount = 0.2 the program program execution. execution.  Variable declaration Dim variableName as datatype e.g : dim studentName as string dim noOfStudent as integer dim schoolFee as double dim DateOfBirth as date
  • 10. Integer Double Integer data type contains any Any number value that may and whole number value that does could contain a fractional part. not have any fractional part. Differentiate between the data types Boolean String Boolean type consists either a Any value that contains a True or False value. Programmers sequence of characters. usually use it to store status.
  • 11. Differentiate between mathematical and logical operators  Operator is a symbol or notation that tells a computer to perform certain actions or operations. Mathematical Meaning Logical Meaning operator operator + Plus And And operator - Minus Or Or operator * Multiply / divide Not Not operator Comparison operator Meaning > Greater than < Less than = Equal <> Not <= Less than or equal
  • 12.  Five main elements in a flow chart Symbols Names Explanation Terminal begin or Use to shows the beginning or end of end a program. Flowlines Use to connect symbols and indicate the sequences of operation. Input or output Use to shows either an input (print / display) operations(e.g. an input from the user) or an output operation(e.g. print or display messages) Process Use to shows a process to be carried (formula) out (e.g. calculator Decision Use to shows a decision(or choice) to (if-then-else) be made. The program should continue along one of two routes(e.g. if…then…else)
  • 13.  Draw a flowchart to show how a program calculates the area of a circle. Begin Get radius Area of ciccle = ½ * PI * radius^2 Print area of circle End
  • 14. Five main phases in program development: Phase Explanation Problem analysis  Identify input, processing, output and data component.  Meet with system analyst and users.  Ask expert. Program design  Divide all program activities into program modules.  Create solution algorithm for each program modules(logic structure).  Design/ draw user interface. Coding  Coding a program involves translating the solution algorithm (writing the program is into programming language usually on paper. called coding)  Typing code into the computer using programming language. Testing and debugging  Manually testing with sample data.  The program is run through computer, using a translator program. Before the program will run, it must be free of syntax error. Documentation  Documentation enables new programmer to understand the flow of program  Is used for future reference in case the program needs change.  Explain the purpose of the code statement.
  • 15. Types of error 1. Syntax error caused by wrong spelling in commands(words) and declaration. Other syntax error include case sensitive and wrong words command. the easiest error to find because they are highlighted by the compiler. Error message are given. example : Source code Syntax error : missing curly braces } If (mark > 50) If (mark > 50) { { Else } { Else { } }
  • 16. latest programming languages: Fifth generation language Fifth generation programming language (5GL) is an advance programming language which concentrates on solving problems using constraints given to the program. In fifth generation language, the programmer just need to define the problem to be solve and the program will automatically code the program based on the problem definition.Fifth generation languages are designed to make the computer solve the problem for you. These languages are mostly used in artificial intelligence research. Examples of fifth generation languages include Prolog and Mercury.
  • 17. openGL (graphic library) OpenGL is a standard specification to describe the standard Application Programming Interface (API) for 3D/2D computer graphic applications. It’s specification describes a set of functions and the exact behaviours that the 3D/2D application must perform. OpenGL was developed by Silicon Graphics. OpenGL is widely used in virtual reality, scientific visualisation, flight simulation and video game development Natural language Natural Language programming aims to use natural language such as English to write a program. Instead of using a specific programming language syntax, natural language programming will use normal English as the input to program software. Such a technique would mean less technical programming knowledge is required to write a program.The programmer needs to define the program using normal language.