La5 Basicelement

  • 1,638 views
Uploaded on

 

More in: Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • good
    Are you sure you want to
    Your message goes here
    Be the first to like this
No Downloads

Views

Total Views
1,638
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
82
Comments
1
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Basic Element 1 – Constant 2 – Variable 3 - Data Type In programming 4 – Operator 5 – Control Structure Prepared by : Norhasimah Mohamed – ICt Teacheri SMK Sungai Pusu Gombak Selangor. 12042008
  • 2. Basic Element In Programming
    • Learning Outcomes
    • 5.1.5.1 Differentiate between constants and variables
    • 5.1.5.2 Differentiate between data types: Boolean, integer, double, string and
    • date.
    • 5.1.5.3 Differentiate between mathematical and logical (Boolean) operators.
    • 5.1.5.4 Differentiate between sequence control structure and selection control
    • structure.
  • 3. Basic element in programming 5 1 2 3 4 5
  • 4.
    • CONSTANTS AND VARIABLES
      • Constants
      • Constant is a data container that stores information.
      • The value that do not change during program execution.
      • They can be of type integer, character or floating-point.
      • Example: Const n As Integer = 10
      • Variables
      • Variable is a data container that stores information.
      • The value inside may change at any time during the course of a program.
      • When create variables, the declaration gives them a symbolic name and definition reserves memory for them.
      • Once defined, variable are used to hold the data that required by program from its operation.
      • Example: Dim mark as integer
    Basic Element In Programming
  • 5.
    • CONSTANTS AND VARIABLES
    Basic Element In Programming
  • 6. Differences between constants and variables
  • 7. Basic Element In Programming
        • DATA TYPES, OPERATOR AND CONTROL STRUCTURES
  • 8.
    • DATA EXAMPLES FOR DIFFERENT DATA TYPES
    • Data type determines the type of data a variable can store, for example a number or a character.
    • Examples of data types are integer, double, string, date and boolean.
    Basic Element In Programming
  • 9.
    • MATHEMATICAL, RELATIONAL AND LOGICAL OPERATORS
    • Operator is a symbol or notation that tells a computer to perform certain actions or operations.
    • An example: the plus (+) notation will tell the computer to perform the "add" operation.
    Basic Element In Programming
  • 10.
    • MATHEMATICAL, RELATIONAL AND LOGICAL OPERATORS
    • Let's look at some examples of Mathematical Operators.
    Basic Element In Programming
  • 11.
    • MATHEMATICAL, RELATIONAL AND LOGICAL OPERATORS
    • Let's look at some examples of Relational Operators.
    Basic Element In Programming
  • 12.
    • MATHEMATICAL, RELATIONAL AND LOGICAL OPERATORS
    • Let's look at some examples of Logical Operators.
    Basic Element In Programming
  • 13. Differences in mathematical and logical operator Mathematical operators perform mathematical operations such as plus or substract. Relational operators perform element-by-element comparisons between two arrays. Logical operators perform logical operations such as checking the condition of two Boolean values.
  • 14.
    • Control structure is a structure of statements in programming that allows the programmer to control the flow of a program.
    • Control structure can be divided into sequence , selection and repetition control structures.
    Control Structure
  • 15.
    • SEQUENCE CONTROL
    • Sequence control refers to the linear execution of codes within a program.
    • In sequence control, the statements are executed one by one in consecutive order.
    Control Structure
  • 16.
    • SELECTION CONTROL
    • There are times when you want your program to make a decision based on the situation given.
    • For example, a program that stores student’s marks may respond differently to different marks. Or maybe a simple mathematical program will display its result as odd or even, based on the result.
    • Selection control enables the programmer to assign different events for different situations.
    • An example of selection control is “If...Then...Else” statement.
    Control Structure
  • 17. Differences between sequence and selection control
  • 18.
    • Pseudo code is text only sentences that describe the logic and program flow of a computer program. Pseudo code esembles plain English.
    • It usually does not have any specific programming language syntax and grammar.
    • Pseudo code is directly linked to the computer codes because each pseudo code statement can often be converted into the programming language virtually line by line.
    • There are no set rules for writing pseudo code.
    • A programmer can have his or her personalised pseudo code.
    • He or she must use consistent language and syntax in the pseudo code, so that he or she can understand it at a later stage.
    PSEUDO CODES
  • 19.
    • A flow chart is a diagram using symbols to show the step-by-step sequence of procedures in a program. A flow chart describes the logic and program flow of a computer program graphically.
    • We have five main elements in a flow chart.
    • Terminator shows the beginning or end of a program.
    • Flowline and arrowhead use to connect symbols and indicate the sequences of operation.
    • Input or output shows either an input operation (e.g. an INPUT from the user) or an output operation (e.g. PRINT some messages).
    • Process shows a process to be carried out (e.g. calculation).
    • Decision shows a decision (or choice) to be made. The program should continue along one of two routes (e.g. if...else).
    FLOW CHART 1 2 3 4 5
  • 20. Complete the handout given Task for today
  • 21. It’s not about a technology… it’s about people ! ‘ Educating the -Generation’ e
  • 22. It’s not about a technology… it’s about learning ! ‘ Educating the -Generation’ e
  • 23. Don’t start with technology, but learning via technology. ‘ Educating the -Generation’ e
  • 24. see
  • 25. end Thank you Prepared by : Norhasimah Mohamed –ICT Teacher SMK Sungai Pusu Gombak Selangor.