Selection Process If … then … else.... Condition Process 2 Process 1 Y.

Slides:



Advertisements
Similar presentations
EXEMPLO DE REMOÇÃO ARVORE if (T = nil) then begin writeln ('ELEMENTO NAO ENCONTRADO NA ARVORE'); end else begin if (X.ch < T^.elem.ch) then.
Advertisements

Основни задачи с файлове. 1. Създаване на файл с фиксиран брой записи Program p1; Type Fl=file of real; Var F:Fl; T:real; I,N:integer; Begin Write(N=);
We can think of numbers being on a number line: These numbers are all positive numbers.
E.g.9 For to do loop for i:=1 to 10 do writeln(i); While do loop i:=1;
SELEKSI IF & CASE. if dengan 1 statement If skor > 8 then Nilai:=‘A’ IF dengan banyak statement If skor > 8 then Begin Nilai := ‘A’; Lulus :=True; Bonus.
Slicing Methods Using Static and Dynamic Information Yoshiyuki Ashida, Fumiaki Ohata, † † † ‡ †‡ Katsuro Inoue Osaka University Nara Institute of Science.
Pascal Syntax. What you have learnt so far writeln() and write(); readln() and read(); variables (integers, strings, character) manipulation of variables.
Selection If Flowchart A diagram that shows step-by-step progression through a procedure or system especially using connecting lines and a set of conventional.
Scientific Programming for(i=0; i b) { a = func1(c,d,i*10); } else if(a < b) { a = func2(e,f,i*10); } else { a = func3(g,h,i*10);
Looping while … do …. Condition Process 2 Process 1 Y Repeated Loop.
Records Dasar Pemrograman. RECORDS Record data types—a complex type that combines different data types into a single record. Sometimes called set types.
ECE453/SE465 Prof. Alencar University of Waterloo 1 Data Flow Testing Slice-Based Testing Winter 2007 Based on the tutorials by Prof. Kontogiannis, Winter.
1 Flowchart If – Then – Else อนันต์ ผลเพิ่ม Anan Phonphoem
Program CheckPass; var TestScore, ExamScore : integer; FinalScore : real; Status : string; begin write(‘Enter the Test score:’); readln(Testscore); write(‘Enter.
J. Michael Moore From James Tam’s material Multi-Dimensional Arrays CSCE 110.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 2, Lecture 2.
J. Michael Moore From James Tam’s material Multi-Dimensional Arrays CSCE 110.
Assembly Language Programming. CPU The CPU contains a Control Unit, Arithmetic Logic Unit (ALU) and a small number of memory locations called Registers.
James Tam Loops In Pascal In this section of notes you will learn how to rerun parts of your program without having to duplicate the code.
Input and Output (IO) CSCE 110 Drawn from James Tam's material.
James Tam Introduction To Files In Pascal In this section of notes you will learn how to read from and write to files in Pascal.
Structured Programming Defn: This is an approach to program development that produces programs of high quality that are easy to test, debug, modify and.
ARRAY PADA PASCAL DOSEN : NURAINI PURWANDARI.
1 The CONST definition CONST Pi = , City = ‘New York’; Constant identifiers are used when you do not want the value of an identifier to change why.
ARRAYS 1.Basic Ideas 2.The Array Type 3.Processing Arrays 4.Parallel Arrays 5.Two-dimensional Array 6.Arrays as Parameters.
Copyright 1999 by Larry Fuhrer. Pascal Programming Getting Started...
Introduction to Pascal The Basics of Program writing.
Pascal Programming Files and Text (an intro). Pascal Programming Files... Data files need to be retained in secondary memory. The machine memory is random.
Programming, an introduction to Pascal
1 st semester Basic Pascal Elements อภิรักษ์ จันทร์สร้าง Aphirak Jansang Computer Engineering.
Pascal Programming Today Chapter 11 1 Chapter 11.
Assignment statement and Arithmetic operation 1 The major part of data processing.
Объекты - списки unit List; interface type TElem = class public p: TElem; s: integer; constructor Create(r: TElem); function Len: integer; function Sum:
1 STRINGS String data type Basic operations on strings String functions String procedures.
int num = 22; if (num > 0) if (num % 5 == 0) System.out.println(num); else System.out.println(num + “ is negative”);
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 11.
1 More on Readln:numerical values Note: ENTER key counts sends a carriage return and a line feed to the computer definition: “white space”: space, tab,
Array : 1-dimension อนันต์ ผลเพิ่ม Anan Phonphoem
Input and Output Output Prompt: –A message displayed to the user indicating what they are to enter. Should be clear and exact on what you want. write:
Lecture 17 If-else statement Nothing is good or bad, but by comparison. Thomas Fuller, Gnomologia.
Looping(1) For … to … do... Can you do this? Write a program to display:
FOR LOOP STRUCTURE For := to do eg. for I := 1 to 100 do begin writeln(‘This is a loop’); end;
ECE 453, Prof. Kontogiannis University of Waterloo 1 Data Flow Testing Slice-Based Testing Winter 2006 Presented by Nikos Giannopoulos
Computer Science 1 9/10/2014 Review Dry Run Math in Pascal How do you start, when you don’t know where to start?
Pascal Programming Today Chapter 2 1 Chapter 2. Pascal Programming Today Chapter 2 2 »Output statements write data to output devices (e.g. VDU). »Two.
Loops When you want a computer to perform the same operation many times you use a loop. Looping is one of the keys to computer programming. First we will.
Definition of the Programming Language CPRL
RECORDS Introduction Declaring a record Using records
The CONST definition CONST Pi = , City = ‘New York’;
Dasar-Dasar Pemrograman
تهیه و تنظیم: فاطمه قاسمی دانشگاه صنعتی شریف – پاییز 86
CMP 131 Introduction to Computer Programming
Паскаль тілінде бағдарламалау II Бөлім
Computer Science and an introduction to Pascal
Көңіл күйлеріңіз қалай?
Сызықтық алгоритмдерді бағдарламалау
Бірөлшемді жиымдар Паскаль тілінде бағдарламалау
تهیه و تنظیم: فاطمه قاسمی دانشگاه صنعتی شریف – پاییز 86
Tiết 46 BÀI THỰC HÀNH SỐ 7 Trường THPT Lê Quý Đôn.
kbkjlj/m/lkiubljj'pl;
TEST II razredi.
Vježbanje.
Vježbanje.
Паскаль тілінің басқару
Қайталау операторлары
9 сынып 8 сабақ Сабақтың тақырыбы: Дейін циклі REPEAT операторы.
Computer Science 2 Take out a piece of paper for the following dry runs. Label It Recursive Dry Runs 4/12/2018. It will be turned in when completed
Computer Science 1 For..do loop Dry Run Take notes on the For loop
Computer Science
Calculate 81 ÷ 3 = 27 3 x 3 x 3 3 x 3 x 3 x 3 ÷ 3 = This could be written as
Presentation transcript:

Selection Process If … then … else...

Condition Process 2 Process 1 Y

Condition Process 1 Process 3 N

Condition Process 2 Process 1 Process 3 Y (then) N (else) If … then … else...

n>=0 Y Readln(n) Writeln(‘Positive’) Readln(n); If n >= 0 then Writeln(‘Positive’)

n>=0 N Readln(n) Writeln(‘Negative’) else Writeln(‘Negative’)

n>=0 Y Readln(n) Writeln(‘Positive’) N Writeln(‘Negative’) Readln(n); If n >= 0 then Writeln(‘Positive’) else Writeln(‘Negative’);

Selection Process If … then …

Condition Process 2 Process 1 Y If (Condition is T) then Process 2

Condition Process 1 N Process 2 If (Condition is T) then Process 2