SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Action 1 Action 2 False True Condition VISUAL BASIC C++ JAVA PASCAL C PROGRAMMING PROGRAMMING CHAPTER 5.0 VISUAL BASIC C++ JAVA PASCAL Action 1 Action 2 False True Condition C
DEFINITION CONTROL  STRUCTURE DATA TYPES OPERATOR CONSTANT &  VARIABLE TRANSLATOR FLOW CHART LEVEL &  GENERATION DEVELOPMENT PHASES DEFINITION CONTROL  STRUCTURE DATA TYPES OPERATOR CONSTANT &  VARIABLE TRANSLATOR FLOW CHART LEVEL &  GENERATION DEVELOPMENT PHASES PROGRAMMING
FIRST GENERATION SECOND GENERATION THIRD GENERATION FOURTH GENERATION FIFTH GENERATION LEVEL OF PROGRAMMING LANGUAGES LOW LEVEL HIGH LEVEL 1 st 2 nd 3 rd 4 th 5 th
LEVEL OF PROGRAMMING LANGUAGES LOW LEVEL FIRST GENERATION SECOND GENERATION THIRD GENERATION FOURTH GENERATION FIFTH GENERATION Machine  Language Assembly  Language High Level  Language Very High  Level  Language Natural  Language BASIC FORTRAN C C++ C# JAVA HIGH LEVEL
FIRST GENERATION OF PROGRAMMING LANGUAGES SECOND THIRD ,[object Object],[object Object],[object Object],MACHINE LANGUAGE ASSEMBLY LANGUAGE HIGH LEVEL LANGUAGE
GENERATION OF PROGRAMMING LANGUAGES THIRD FOURTH FIFTH Get me computer sales in February. List me students from class 5S2. SELECT  SUM(total_price)  FROM  sales  WHERE  month = Feb SELECT  student  FROM  datafile  WHERE  class = 5S2  n = 1 Do If  class =“5S2”  Then name[n] = NameFromFile End If n = n + 1 Loop Until  EOF(student) VERY HIGH LEVEL LANGUAGE NATURAL LANGUAGE HIGH LEVEL LANGUAGE
FIRST TYPE OF TRANSLATORS SECOND THIRD ,[object Object],[object Object],MACHINE LANGUAGE ASSEMBLY LANGUAGE HIGH LEVEL LANGUAGE ASSEMBLER INTERPRETER COMPILER IF   MARKS > 50  THEN PRINT “LULUS” ELSE PRINT “GAGAL” END IF
High Level Language Machine Language into Compiler & Interpreter are programs that translate high level language into machine language Source Code (High Level Language) Object Code (Machine Language) 10  Input  “Number 1” ; x 20  Input  “Number” ; y 30  z = x + y 40  Print  “Answer “ ; z 0010001 010010 0000100 0001001 001000 0010000 0010001 010010 0000001 0010011 010101 1010101
Interpreter Compiler Line by Line Entire program
Dim  Name as String Dim  Score as Integer Dim  Mark as Integer examples Const  PI = 3.142 Const  GRAVITY = 9.8 Const  WAGE = 5.5 Variables  can change   their value  during the program execution. characteristics Constants  retain   their value  during the program execution. Variables difference Constants
Date data type contains  date  and  time  value. Date Boolean data type contains either a  true  or  false  value.  Boolean (Logical Value) String data type contains a  sequence of character . String (Text) Double data type contains any  decimal number  value that  has a fractional part.   Double (Number) Integer data type contains any  whole number  value that  does not have any frictional part.  Integer (Number) Explanation Data types
Datatypes Examples Value Datatype N/A Any datatypes Variant 12/5/2008 Date or time Date True or False Logical values Boolean Abu Hassan Jalan Bahagia Text information String RM 123.45 3.5 kg Decimal numbers Double 107 students -6 0  Celcius Whole numbers Integer
Complete Datatype 0 to 255 Whole numbers Byte N/A Any of the preceding datatypes Variant Jan 1st 100 to December 31st 9999 Date and time information Date True or False Logical values Boolean Up to 65,000 characters for fixed-length strings and up to 2 billion characters for dynamic strings Text information String 922,337,203,685,477.5808 to 922,337,203,685,477.5807 Numbers with up to 15 digits left of the decimal and 4 digits right of the decimal Currency -1.79769313486232E308 to -4.94065645841247E-324 for negative values and 4.94065645841247E-324 to 1.79769313486232E308 for positive values Decimal numbers Double -3.402823E38 to -1.401298E-45 for negative values and 1.401298E-45 to 3.402823E38 for positive values Decimal numbers Single Approximately +/- 2.1E9 Whole numbers Long -32,768 to 32,767 Whole numbers Integer
OPERATOR Assignment  Operator Mathematical  Operator Comparison  Operator Logical  Operator An operator is a symbol that causes VB to take an action  causes the left side  operand   to have  right side  value to perform  mathematical   operations   to compare  two value and return value whether true or false  to perform  logical operations  and return value whether true or false
Age = 17 operand Asssignment operator
OPERATOR Divide / Not Operator Not Multiply * Or Operator Or Minus - And Operator And Plus + Meaning Logical Operator Meaning Mathematical Operator
OPERATOR Not Equal <> Equal = Less  Than or equal <= Less than < Greater Than or equal >= Greater than > Comparison Operator Meaning Comparison Operator
Action 1 Action 2 False True Condition Action 1 Action 2 Action 3 SEQUENCE SELECTION CONTROL STRUCTURE
BEGIN READ  Number Of Share IF  Number Of Share >= 1  THEN Dividend = Number Of Share x 5 % PRINT  Dividend ELSE PRINT  Error Message END IF END END BEGIN READ  Number of Share False True
END BEGIN Average = (Number1 + Number2 + Number3)/3 Print Average Get Number1 Get Number2 Get Number3 Declaration Dim Number1 as Double Dim Number2 as Double Dim Number3 as Double Dim Average as Double Process Average = (Number1 + Number2 + Number3)/3 Output txtAverage.text = Average Input Number1 = txtNumber1.text Number2 = txtNumber2.text Number3 = txtNumber3.text
Syarat Kemasukan SERATA ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Logical Operator Comparison Operator
FLOW CHART 5
FLOW CHART parallelogram rectangle diamond oval arrow 5
FLOW CHART parallelogram rectangle diamond oval arrow DECISION PROCESS INPUT/OUTPUT FLOWLINE TERMINAL 5
FLOW CHART parallelogram rectangle diamond oval arrow DECISION PROCESS INPUT/OUTPUT FLOWLINE TERMINAL FORMULA READ / PRINT IF – THEN - ELSE BEGIN  /  END 5
STRUCTURED APPROACH OBJECT ORIENTED APPROACH Structured Approach  is a computer  programming  technique  in which the program is divided  into  modules  like  function  or subroutine. Object Oriented Approach  is a computer  programming techniques  based on the concept of an “ object ” that  combine both  data  and the  function  into a single unit.
10 INPUT “X” 20 IF X = 2 THEN  GOTO 60  ELSE  GOTO 90 30 PRINT “NUMBER ”;X  40 PRINT “PLEASE TRY AGAIN” 50 END 60 PRINT “NUMBER “;X 70 PRINT “GOOD” 90 END BASIC FORTRAN COBOL Spaghetti Kangaroo Code Code
STRUCTURED APPROACH Structured Approach  is a computer  programming  technique  in which the program is divided  into  modules  like  function  or subroutine. GetInput (x, y) z = Process (x, y) DisplayResult (z) Sub  GetInput (x as integer) Input “Number 1” ; x Input “Number 2” ; y End Sub Function  Process (x as integer) as integer Process = x + y End Function Sub  DisplayResult (x as integer) Print x;”+”;y;”=“;z End Sub
OBJECT ORIENTED APPROACH Object Oriented Approach  is a computer  programming techniques  based on the concept of an “ object ” that  combine both  data  and the  function  into a single unit.  object data function Class aCircle Const PI = 3.142 Dim   mRadius  As Single Function Diameter() As Single  Return 2 * mRadius End Function Function Area() As Single  Return PI * mRadius * mRadius End Function Function Circumference() As Single Return 2 * PI * mRadius End Function End Class Dim  my Circle   As  New  a Circle my Circle . Radius  =  10 Print   my Circle .Area Print  myCircle.Diameter Print   my Circle .Circumference ( method )
OBJECT ORIENTED CONCEPT Inheritance Polymorphism Overloading 1 2 3 4 Encapsulation
Object Properties Method Event 1 2 3
main() { int radius; cout << “Area of circle is “ <<  getArea(4); cout << “Circumference of circle is” << getCircumference(4); } double getArea(int r) { double area; area = 3.142 * r * r; return area; } double getCircumference(int r)  { double circumference; circumference = 2 * 3.142 * r ; return circumference; }  class Circle {   private int radius;      public void setRadius(int r) {  radius = r;   }   public double getArea() {    double area;   area = 3.142 * radius * radius;   return area;   }   } class FindCircle { public static void main() {   Circle  circle1; circle1.setRadius(4); cout << “Area of circle is” << circle1.getArea(); }  STRUCTURED data function class Circle {   private int radius;      public void setRadius(int r) {  radius = r;   }   public double getArea() {    double area;   area = 3.142 * radius * radius;   return area;   }   } OOP object
Kangaroo Code Structured Object Oriented goto function object = function + data Approach Approach

Weitere ähnliche Inhalte

Was ist angesagt?

Intermediate code generation1
Intermediate code generation1Intermediate code generation1
Intermediate code generation1Shashwat Shriparv
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generationAkshaya Arunan
 
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Saikrishna Tanguturu
 
Building blocks 2
Building blocks 2Building blocks 2
Building blocks 2NAZIRGUJJAR
 
Algorithmsandflowcharts2
Algorithmsandflowcharts2Algorithmsandflowcharts2
Algorithmsandflowcharts2Darlene Interno
 
Algorithms and flowcharts1
Algorithms and flowcharts1Algorithms and flowcharts1
Algorithms and flowcharts1Lincoln School
 
Database Management System-session 3-4-5
Database Management System-session 3-4-5Database Management System-session 3-4-5
Database Management System-session 3-4-5Infinity Tech Solutions
 
programming fortran 77 Slide01
programming fortran 77 Slide01programming fortran 77 Slide01
programming fortran 77 Slide01Ahmed Gamal
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design) Tasif Tanzim
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler DesignShine Raj
 

Was ist angesagt? (19)

Getting Started with C++
Getting Started with C++Getting Started with C++
Getting Started with C++
 
Intermediate code generation1
Intermediate code generation1Intermediate code generation1
Intermediate code generation1
 
Chapter 6 Intermediate Code Generation
Chapter 6   Intermediate Code GenerationChapter 6   Intermediate Code Generation
Chapter 6 Intermediate Code Generation
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
Compiler Design - Ambiguous grammar, LMD & RMD, Infix & Postfix, Implementati...
 
Back patching
Back patchingBack patching
Back patching
 
C++ Language
C++ LanguageC++ Language
C++ Language
 
Basics of c++
Basics of c++Basics of c++
Basics of c++
 
C programming part4
C programming part4C programming part4
C programming part4
 
Building blocks 2
Building blocks 2Building blocks 2
Building blocks 2
 
Algorithmsandflowcharts2
Algorithmsandflowcharts2Algorithmsandflowcharts2
Algorithmsandflowcharts2
 
Algorithms and flowcharts1
Algorithms and flowcharts1Algorithms and flowcharts1
Algorithms and flowcharts1
 
Database Management System-session 3-4-5
Database Management System-session 3-4-5Database Management System-session 3-4-5
Database Management System-session 3-4-5
 
programming fortran 77 Slide01
programming fortran 77 Slide01programming fortran 77 Slide01
programming fortran 77 Slide01
 
C++ Tokens
C++ TokensC++ Tokens
C++ Tokens
 
Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)   Intermediate code generation (Compiler Design)
Intermediate code generation (Compiler Design)
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler Design
 
Flow chart
Flow chartFlow chart
Flow chart
 

Andere mochten auch

Swift 0x02 기본 연산자
Swift 0x02   기본 연산자Swift 0x02   기본 연산자
Swift 0x02 기본 연산자Hyun Jin Moon
 
3 number systems-floatingpoint
3 number systems-floatingpoint3 number systems-floatingpoint
3 number systems-floatingpointirdginfo
 
2ndQuarter2ndMeeting(formatting number)
2ndQuarter2ndMeeting(formatting number)2ndQuarter2ndMeeting(formatting number)
2ndQuarter2ndMeeting(formatting number)Esmeraldo Jr Guimbarda
 
Week 5 java script functions
Week 5  java script functionsWeek 5  java script functions
Week 5 java script functionsbrianjihoonlee
 
Functional Programming in Java 8 - Exploiting Lambdas
Functional Programming in Java 8 - Exploiting LambdasFunctional Programming in Java 8 - Exploiting Lambdas
Functional Programming in Java 8 - Exploiting LambdasGanesh Samarthyam
 
java script functions, classes
java script functions, classesjava script functions, classes
java script functions, classesVijay Kalyan
 
Lambda functions in java 8
Lambda functions in java 8Lambda functions in java 8
Lambda functions in java 8James Brown
 
TM 2nd qtr-3ndmeeting(java script-functions)
TM 2nd qtr-3ndmeeting(java script-functions)TM 2nd qtr-3ndmeeting(java script-functions)
TM 2nd qtr-3ndmeeting(java script-functions)Esmeraldo Jr Guimbarda
 
ITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function ProgrammingITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function ProgrammingIstanbul Tech Talks
 
Java Script - Object-Oriented Programming
Java Script - Object-Oriented ProgrammingJava Script - Object-Oriented Programming
Java Script - Object-Oriented Programmingintive
 
02 java programming basic
02  java programming basic02  java programming basic
02 java programming basicZeeshan-Shaikh
 
Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...
Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...
Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...Philip Schwarz
 
Input and Output
Input and OutputInput and Output
Input and OutputSean Chia
 
Information system
Information systemInformation system
Information systemSean Chia
 

Andere mochten auch (20)

Swift 0x02 기본 연산자
Swift 0x02   기본 연산자Swift 0x02   기본 연산자
Swift 0x02 기본 연산자
 
3 number systems-floatingpoint
3 number systems-floatingpoint3 number systems-floatingpoint
3 number systems-floatingpoint
 
Programming
ProgrammingProgramming
Programming
 
2ndQuarter2ndMeeting(formatting number)
2ndQuarter2ndMeeting(formatting number)2ndQuarter2ndMeeting(formatting number)
2ndQuarter2ndMeeting(formatting number)
 
Week 5 java script functions
Week 5  java script functionsWeek 5  java script functions
Week 5 java script functions
 
Functional Programming in Java
Functional Programming in JavaFunctional Programming in Java
Functional Programming in Java
 
2java Oop
2java Oop2java Oop
2java Oop
 
Functional Programming in Java 8 - Exploiting Lambdas
Functional Programming in Java 8 - Exploiting LambdasFunctional Programming in Java 8 - Exploiting Lambdas
Functional Programming in Java 8 - Exploiting Lambdas
 
java script functions, classes
java script functions, classesjava script functions, classes
java script functions, classes
 
Lambda functions in java 8
Lambda functions in java 8Lambda functions in java 8
Lambda functions in java 8
 
TM 2nd qtr-3ndmeeting(java script-functions)
TM 2nd qtr-3ndmeeting(java script-functions)TM 2nd qtr-3ndmeeting(java script-functions)
TM 2nd qtr-3ndmeeting(java script-functions)
 
ITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function ProgrammingITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function Programming
 
Java Script - Object-Oriented Programming
Java Script - Object-Oriented ProgrammingJava Script - Object-Oriented Programming
Java Script - Object-Oriented Programming
 
02 java programming basic
02  java programming basic02  java programming basic
02 java programming basic
 
Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...
Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...
Understanding Java 8 Lambdas and Streams - Part 1 - Lambda Calculus, Lambda...
 
Fp java8
Fp java8Fp java8
Fp java8
 
Input and Output
Input and OutputInput and Output
Input and Output
 
Security
SecuritySecurity
Security
 
Functions in javascript
Functions in javascriptFunctions in javascript
Functions in javascript
 
Information system
Information systemInformation system
Information system
 

Ähnlich wie Programming Language Generations Structures Concepts

Kuliah komputer pemrograman
Kuliah  komputer pemrogramanKuliah  komputer pemrograman
Kuliah komputer pemrogramanhardryu
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxSONU KUMAR
 
1_Python Basics.pdf
1_Python Basics.pdf1_Python Basics.pdf
1_Python Basics.pdfMaheshGour5
 
Introduction to design and analysis of algorithm
Introduction to design and analysis of algorithmIntroduction to design and analysis of algorithm
Introduction to design and analysis of algorithmDevaKumari Vijay
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented TechnologiesUmesh Nikam
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowchartsSamuel Igbanogu
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshopBAINIDA
 
Python_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptxPython_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptxSahajShrimal1
 
Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0Sheik Uduman Ali
 

Ähnlich wie Programming Language Generations Structures Concepts (20)

Kuliah komputer pemrograman
Kuliah  komputer pemrogramanKuliah  komputer pemrograman
Kuliah komputer pemrograman
 
C program
C programC program
C program
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
 
Introduction to Python
Introduction to Python  Introduction to Python
Introduction to Python
 
1_Python Basics.pdf
1_Python Basics.pdf1_Python Basics.pdf
1_Python Basics.pdf
 
Operators1.pptx
Operators1.pptxOperators1.pptx
Operators1.pptx
 
lecture 2.pptx
lecture 2.pptxlecture 2.pptx
lecture 2.pptx
 
dinoC_ppt.pptx
dinoC_ppt.pptxdinoC_ppt.pptx
dinoC_ppt.pptx
 
Introduction to design and analysis of algorithm
Introduction to design and analysis of algorithmIntroduction to design and analysis of algorithm
Introduction to design and analysis of algorithm
 
Python
PythonPython
Python
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
Ch03
Ch03Ch03
Ch03
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented Technologies
 
Welcome to python workshop
Welcome to python workshopWelcome to python workshop
Welcome to python workshop
 
2. operator
2. operator2. operator
2. operator
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshop
 
Python_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptxPython_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptx
 
Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0Let Us Learn Lambda Using C# 3.0
Let Us Learn Lambda Using C# 3.0
 
C language basics
C language basicsC language basics
C language basics
 

Mehr von Sean Chia

Teknik menjawab soalan ict spm 2015
Teknik menjawab soalan ict spm 2015Teknik menjawab soalan ict spm 2015
Teknik menjawab soalan ict spm 2015Sean Chia
 
Network cabling
Network cablingNetwork cabling
Network cablingSean Chia
 
Generation of Computer
Generation of ComputerGeneration of Computer
Generation of ComputerSean Chia
 
Authentication
AuthenticationAuthentication
AuthenticationSean Chia
 
System software
System softwareSystem software
System softwareSean Chia
 
Crimping and Testing
Crimping and TestingCrimping and Testing
Crimping and TestingSean Chia
 

Mehr von Sean Chia (11)

Atomy
AtomyAtomy
Atomy
 
Teknik menjawab soalan ict spm 2015
Teknik menjawab soalan ict spm 2015Teknik menjawab soalan ict spm 2015
Teknik menjawab soalan ict spm 2015
 
Network cabling
Network cablingNetwork cabling
Network cabling
 
Multimedia
MultimediaMultimedia
Multimedia
 
Generation of Computer
Generation of ComputerGeneration of Computer
Generation of Computer
 
Authentication
AuthenticationAuthentication
Authentication
 
System software
System softwareSystem software
System software
 
Storage
StorageStorage
Storage
 
Motherboard
MotherboardMotherboard
Motherboard
 
Networking
NetworkingNetworking
Networking
 
Crimping and Testing
Crimping and TestingCrimping and Testing
Crimping and Testing
 

Programming Language Generations Structures Concepts

  • 1. Action 1 Action 2 False True Condition VISUAL BASIC C++ JAVA PASCAL C PROGRAMMING PROGRAMMING CHAPTER 5.0 VISUAL BASIC C++ JAVA PASCAL Action 1 Action 2 False True Condition C
  • 2. DEFINITION CONTROL STRUCTURE DATA TYPES OPERATOR CONSTANT & VARIABLE TRANSLATOR FLOW CHART LEVEL & GENERATION DEVELOPMENT PHASES DEFINITION CONTROL STRUCTURE DATA TYPES OPERATOR CONSTANT & VARIABLE TRANSLATOR FLOW CHART LEVEL & GENERATION DEVELOPMENT PHASES PROGRAMMING
  • 3. FIRST GENERATION SECOND GENERATION THIRD GENERATION FOURTH GENERATION FIFTH GENERATION LEVEL OF PROGRAMMING LANGUAGES LOW LEVEL HIGH LEVEL 1 st 2 nd 3 rd 4 th 5 th
  • 4. LEVEL OF PROGRAMMING LANGUAGES LOW LEVEL FIRST GENERATION SECOND GENERATION THIRD GENERATION FOURTH GENERATION FIFTH GENERATION Machine Language Assembly Language High Level Language Very High Level Language Natural Language BASIC FORTRAN C C++ C# JAVA HIGH LEVEL
  • 5.
  • 6. GENERATION OF PROGRAMMING LANGUAGES THIRD FOURTH FIFTH Get me computer sales in February. List me students from class 5S2. SELECT SUM(total_price) FROM sales WHERE month = Feb SELECT student FROM datafile WHERE class = 5S2 n = 1 Do If class =“5S2” Then name[n] = NameFromFile End If n = n + 1 Loop Until EOF(student) VERY HIGH LEVEL LANGUAGE NATURAL LANGUAGE HIGH LEVEL LANGUAGE
  • 7.
  • 8. High Level Language Machine Language into Compiler & Interpreter are programs that translate high level language into machine language Source Code (High Level Language) Object Code (Machine Language) 10 Input “Number 1” ; x 20 Input “Number” ; y 30 z = x + y 40 Print “Answer “ ; z 0010001 010010 0000100 0001001 001000 0010000 0010001 010010 0000001 0010011 010101 1010101
  • 9. Interpreter Compiler Line by Line Entire program
  • 10. Dim Name as String Dim Score as Integer Dim Mark as Integer examples Const PI = 3.142 Const GRAVITY = 9.8 Const WAGE = 5.5 Variables can change their value during the program execution. characteristics Constants retain their value during the program execution. Variables difference Constants
  • 11. Date data type contains date and time value. Date Boolean data type contains either a true or false value. Boolean (Logical Value) String data type contains a sequence of character . String (Text) Double data type contains any decimal number value that has a fractional part. Double (Number) Integer data type contains any whole number value that does not have any frictional part. Integer (Number) Explanation Data types
  • 12. Datatypes Examples Value Datatype N/A Any datatypes Variant 12/5/2008 Date or time Date True or False Logical values Boolean Abu Hassan Jalan Bahagia Text information String RM 123.45 3.5 kg Decimal numbers Double 107 students -6 0 Celcius Whole numbers Integer
  • 13. Complete Datatype 0 to 255 Whole numbers Byte N/A Any of the preceding datatypes Variant Jan 1st 100 to December 31st 9999 Date and time information Date True or False Logical values Boolean Up to 65,000 characters for fixed-length strings and up to 2 billion characters for dynamic strings Text information String 922,337,203,685,477.5808 to 922,337,203,685,477.5807 Numbers with up to 15 digits left of the decimal and 4 digits right of the decimal Currency -1.79769313486232E308 to -4.94065645841247E-324 for negative values and 4.94065645841247E-324 to 1.79769313486232E308 for positive values Decimal numbers Double -3.402823E38 to -1.401298E-45 for negative values and 1.401298E-45 to 3.402823E38 for positive values Decimal numbers Single Approximately +/- 2.1E9 Whole numbers Long -32,768 to 32,767 Whole numbers Integer
  • 14. OPERATOR Assignment Operator Mathematical Operator Comparison Operator Logical Operator An operator is a symbol that causes VB to take an action causes the left side operand to have right side value to perform mathematical operations to compare two value and return value whether true or false to perform logical operations and return value whether true or false
  • 15. Age = 17 operand Asssignment operator
  • 16. OPERATOR Divide / Not Operator Not Multiply * Or Operator Or Minus - And Operator And Plus + Meaning Logical Operator Meaning Mathematical Operator
  • 17. OPERATOR Not Equal <> Equal = Less Than or equal <= Less than < Greater Than or equal >= Greater than > Comparison Operator Meaning Comparison Operator
  • 18. Action 1 Action 2 False True Condition Action 1 Action 2 Action 3 SEQUENCE SELECTION CONTROL STRUCTURE
  • 19. BEGIN READ Number Of Share IF Number Of Share >= 1 THEN Dividend = Number Of Share x 5 % PRINT Dividend ELSE PRINT Error Message END IF END END BEGIN READ Number of Share False True
  • 20. END BEGIN Average = (Number1 + Number2 + Number3)/3 Print Average Get Number1 Get Number2 Get Number3 Declaration Dim Number1 as Double Dim Number2 as Double Dim Number3 as Double Dim Average as Double Process Average = (Number1 + Number2 + Number3)/3 Output txtAverage.text = Average Input Number1 = txtNumber1.text Number2 = txtNumber2.text Number3 = txtNumber3.text
  • 21.
  • 23. FLOW CHART parallelogram rectangle diamond oval arrow 5
  • 24. FLOW CHART parallelogram rectangle diamond oval arrow DECISION PROCESS INPUT/OUTPUT FLOWLINE TERMINAL 5
  • 25. FLOW CHART parallelogram rectangle diamond oval arrow DECISION PROCESS INPUT/OUTPUT FLOWLINE TERMINAL FORMULA READ / PRINT IF – THEN - ELSE BEGIN / END 5
  • 26. STRUCTURED APPROACH OBJECT ORIENTED APPROACH Structured Approach is a computer programming technique in which the program is divided into modules like function or subroutine. Object Oriented Approach is a computer programming techniques based on the concept of an “ object ” that combine both data and the function into a single unit.
  • 27. 10 INPUT “X” 20 IF X = 2 THEN GOTO 60 ELSE GOTO 90 30 PRINT “NUMBER ”;X 40 PRINT “PLEASE TRY AGAIN” 50 END 60 PRINT “NUMBER “;X 70 PRINT “GOOD” 90 END BASIC FORTRAN COBOL Spaghetti Kangaroo Code Code
  • 28. STRUCTURED APPROACH Structured Approach is a computer programming technique in which the program is divided into modules like function or subroutine. GetInput (x, y) z = Process (x, y) DisplayResult (z) Sub GetInput (x as integer) Input “Number 1” ; x Input “Number 2” ; y End Sub Function Process (x as integer) as integer Process = x + y End Function Sub DisplayResult (x as integer) Print x;”+”;y;”=“;z End Sub
  • 29. OBJECT ORIENTED APPROACH Object Oriented Approach is a computer programming techniques based on the concept of an “ object ” that combine both data and the function into a single unit. object data function Class aCircle Const PI = 3.142 Dim mRadius As Single Function Diameter() As Single Return 2 * mRadius End Function Function Area() As Single Return PI * mRadius * mRadius End Function Function Circumference() As Single Return 2 * PI * mRadius End Function End Class Dim my Circle As New a Circle my Circle . Radius = 10 Print my Circle .Area Print myCircle.Diameter Print my Circle .Circumference ( method )
  • 30. OBJECT ORIENTED CONCEPT Inheritance Polymorphism Overloading 1 2 3 4 Encapsulation
  • 32. main() { int radius; cout << “Area of circle is “ << getArea(4); cout << “Circumference of circle is” << getCircumference(4); } double getArea(int r) { double area; area = 3.142 * r * r; return area; } double getCircumference(int r) { double circumference; circumference = 2 * 3.142 * r ; return circumference; } class Circle { private int radius; public void setRadius(int r) { radius = r; } public double getArea() { double area; area = 3.142 * radius * radius; return area; } } class FindCircle { public static void main() { Circle circle1; circle1.setRadius(4); cout << “Area of circle is” << circle1.getArea(); } STRUCTURED data function class Circle { private int radius; public void setRadius(int r) { radius = r; } public double getArea() { double area; area = 3.142 * radius * radius; return area; } } OOP object
  • 33. Kangaroo Code Structured Object Oriented goto function object = function + data Approach Approach