Download presentation
Presentation is loading. Please wait.
Published byOlivia Taylor Modified over 9 years ago
1
Action 1 Action 2 False True Condition Action 1 Action 2 False True Condition
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
4
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
5
1010 1001001 100101 1101 1110111 000110 1001 101010 1001101 MACHINE LANGUAGE ASSEMBLY LANGUAGE HIGH LEVEL LANGUAGE
6
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
1010 1001001 100101 1101 1110111 000110 MACHINE LANGUAGE ASSEMBLY LANGUAGE HIGH LEVEL LANGUAGE ASSEMBLER INTERPRETER COMPILER IF MARKS > 50 THEN PRINT “LULUS” ELSE PRINT “GAGAL” END IF
8
High Level Language Machine Language into 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
10
ConstantsdifferenceVariables Constants retain their value during the program execution. characteristics Variables can change their value during the program execution. Const PI = 3.142 Const GRAVITY = 9.8 Const WAGE = 5.5 examples Dim Name as String Dim Score as Integer Dim Mark as Integer
11
Data typesExplanation Integer (Number) Integer data type contains any whole number value that does not have any frictional part. Double (Number) Double data type contains any decimal number value that has a fractional part. String (Text) String data type contains a sequence of character. Boolean (Logical Value) Boolean data type contains either a true or false value. Date Date data type contains date and time value.
12
DatatypeValueExamples IntegerWhole numbers 107 students -6 0 Celcius DoubleDecimal numbers RM 123.45 3.5 kg StringText information Abu Hassan Jalan Bahagia BooleanLogical valuesTrue or False DateDate or time12/5/2008 VariantAny datatypesN/A
13
IntegerWhole numbers-32,768 to 32,767 LongWhole numbersApproximately +/- 2.1E9 ByteWhole numbers0 to 255 SingleDecimal numbers-3.402823E38 to -1.401298E-45 for negative values and 1.401298E-45 to 3.402823E38 for positive values DoubleDecimal numbers-1.79769313486232E308 to - 4.94065645841247E-324 for negative values and 4.94065645841247E-324 to 1.79769313486232E308 for positive values CurrencyNumbers with up to 15 digits left of the decimal and 4 digits right of the decimal 922,337,203,685,477.5808 to 922,337,203,685,477.5807 StringText informationUp to 65,000 characters for fixed-length strings and up to 2 billion characters for dynamic strings BooleanLogical valuesTrue or False DateDate and time information Jan 1st 100 to December 31st 9999 VariantAny of the preceding datatypes N/A
14
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
Mathematical Operator Meaning Logical Operator Meaning + Plus And And Operator - Minus Or Or Operator * Multiply Not Not Operator / Divide
17
Comparison Operator Meaning Comparison Operator > Greater than >= Greater Than or equal < Less than <= Less Than or equal = Equal <> Not Equal
18
Action 1 Action 2 False True Condition Action 1 Action 2 Action 3
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 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
Syarat Kemasukan SERATA Bahasa Arab = Lulus Bilangan A > 4 If BahasaArab = Lulus And BilA > 4 Then DiTerima Masuk Serata Else Sila mohon ke sekolah lain End If Logical Operator Comparison Operator
23
parallelogram rectangle diamond oval arrow
24
parallelogram rectangle diamond oval arrow
25
parallelogram rectangle diamond oval arrow FORMULA READ / PRINT IF – THEN - ELSE BEGIN / END
26
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
28
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 is a computer programming techniques based on the concept of an “object” that combine both data and the function into a single unit. 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 myCircle As New aCircle myCircle.Radius = 10 Print myCircle.Area Print myCircle.Diameter Print myCircle.Circumference
30
1 2 3 4
31
1 2 3
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(); } 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; } } object
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.