Action 1 Action 2 False True Condition Action 1 Action 2 False True Condition.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

This is Java Jeopardy.
IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
Aalborg Media Lab 21-Jun-15 Software Design Lecture 2 “ Data and Expressions”
Introduction to Computers and Programming Lecture 5 Boolean type; if statement Professor: Evan Korth New York University.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
Data types and variables
JavaScript, Fourth Edition
JavaScript, Third Edition
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
Objectives You should be able to describe: Data Types
High-Level Programming Languages: C++
Intro to Programming Problem 1: Computers have to be told exactly what do to. Problem 2: Computers only understand “Machine language”. Problem 3: Machine.
CIS Computer Programming Logic
Mr C Johnston ICT Teacher BTEC IT Unit 06 - Lesson 05 Learning To Program.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
2440: 211 Interactive Web Programming Expressions & Operators.
National Diploma Unit 4 Introduction to Software Development Data types, variables and constants.
Computer Science Selection Structures.
Chapter 3: Data Types and Operators JavaScript - Introductory.
Lecture 8 Visual Basic (2).
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
CSE 131 Computer Science 1 Module 1: (basics of Java)
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Software Life Cycle What Requirements Gathering, Problem definition
Lecture #5 Introduction to C++
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
CONTROLLING PROGRAM FLOW
C++ Programming: Basic Elements of C++.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
Using Data Within a Program Chapter 2.  Classes  Methods  Statements  Modifiers  Identifiers.
1 st Semester Module2 Basic C# Concept อภิรักษ์ จันทร์สร้าง Aphirak Jansang Computer Engineering.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Programming, an introduction to Pascal
1 Flow Control Ifs, loops. 2 Data Type At the lowest level, all data in a computer is written in 1’s and 0’s (binary) How the data gets interpreted, what.
CNS 1120 Exam 1 Review. Programming Language Elements Syntax = the rules to follow Syntax = the rules to follow Semantics = the meaning of symbols Semantics.
Repetition. Loops Allows the same set of instructions to be used over and over again Starts with the keyword loop and ends with end loop. This will create.
Review TEST 2 Chapters 4,5,7. QUESTION For which type of operands does the == operator always work correctly: (a) int, (b) double, or (c) String?
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
1 MODULAR DESIGN AND ABSTRACTION. 2 SPECIFYING THE DETAILS OF A PROBLEM INTO A RELATED SET OF SMALLER PROBLEMS.
By Mr. Muhammad Pervez Akhtar
CPS120: Introduction to Computer Science Variables and Constants.
Variables and Expressions Programming Right from the Start with Visual Basic.NET 1/e 7.
Controlling Program Flow with Decision Structures.
Chapter 7 Conditional Statements. 7.1 Conditional Expressions Conditions - compare the values of variables, constants and literals using one or more relational.
Expressions and Order of Operations Operators – There are the standard operators: add, subtract, divide, multiply – Note that * means multiply? (No times.
Dr. Sajib Datta Jan 21,  Declare a variable ◦ int height; [note that no value is still assigned]  Assign a variable a value ◦ height =
Chad’s C++ Tutorial Demo Outline. 1. What is C++? C++ is an object-oriented programming (OOP) language that is viewed by many as the best language for.
Lesson 4: Introduction to Control Statements 4.1 Additional Operators Extended Assignment Operators –The assignment operator can be combined with the.
TUTORIAL 4 Visual Basic 6.0 Mr. Crone. Pseudocode Pseudocode is written language that is part-code part- English and helps a programmer to plan the layout.
Lecture 3: More Java Basics Michael Hsu CSULA. Recall From Lecture Two  Write a basic program in Java  The process of writing, compiling, and running.
7 - Programming 7J, K, L, M, N, O – Handling Data.
CompSci 230 S Programming Techniques
Basic concepts of C++ Presented by Prof. Satyajit De
Chapter 1.2 Introduction to C++ Programming
Egyptian Language School Computer Department
Chapter 1.2 Introduction to C++ Programming
Data Types and Expressions
Chapter 1.2 Introduction to C++ Programming
Chapter 1.2 Introduction to C++ Programming
Computer Programming.
BASIC ELEMENTS OF A COMPUTER PROGRAM
The Selection Structure
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Presentation transcript:

Action 1 Action 2 False True Condition Action 1 Action 2 False True Condition

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

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

MACHINE LANGUAGE ASSEMBLY LANGUAGE HIGH LEVEL LANGUAGE

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

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 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

ConstantsdifferenceVariables Constants retain their value during the program execution. characteristics Variables can change their value during the program execution. Const PI = Const GRAVITY = 9.8 Const WAGE = 5.5 examples Dim Name as String Dim Score as Integer Dim Mark as Integer

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.

DatatypeValueExamples IntegerWhole numbers 107 students -6 0 Celcius DoubleDecimal numbers RM kg StringText information Abu Hassan Jalan Bahagia BooleanLogical valuesTrue or False DateDate or time12/5/2008 VariantAny datatypesN/A

IntegerWhole numbers-32,768 to 32,767 LongWhole numbersApproximately +/- 2.1E9 ByteWhole numbers0 to 255 SingleDecimal numbers E38 to E-45 for negative values and E-45 to E38 for positive values DoubleDecimal numbers E308 to E-324 for negative values and E-324 to E308 for positive values CurrencyNumbers with up to 15 digits left of the decimal and 4 digits right of the decimal 922,337,203,685, to 922,337,203,685, 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

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

Mathematical Operator Meaning Logical Operator Meaning + Plus And And Operator - Minus Or Or Operator * Multiply Not Not Operator / Divide

Comparison Operator Meaning Comparison Operator > Greater than >= Greater Than or equal < Less than <= Less Than or equal = Equal <> Not Equal

Action 1 Action 2 False True Condition Action 1 Action 2 Action 3

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

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 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

parallelogram rectangle diamond oval arrow

parallelogram rectangle diamond oval arrow

parallelogram rectangle diamond oval arrow FORMULA READ / PRINT IF – THEN - ELSE BEGIN / END

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 PRINT “NUMBER ”;X 40 PRINT “PLEASE TRY AGAIN” 50 END 60 PRINT “NUMBER “;X 70 PRINT “GOOD” 90 END

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 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 = 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

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 = * r * r; return area; } double getCircumference(int r) { double circumference; circumference = 2 * * r ; return circumference; } class Circle { private int radius; public void setRadius(int r) { radius = r; } public double getArea() { double area; area = * 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 = * radius * radius; return area; } } object