Algoritma & Pemrograman 1

Slides:



Advertisements
Similar presentations
Session 1 & 2BBK P1 Module5-May-2007 : [‹#›] PHP: Moving On..
Advertisements

IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
Chapter 2: Java Fundamentals Operators. Introduction to OOP Dr. S. GANNOUNI & Dr. A. TOUIR Page 2 Content Group of Operators Arithmetic Operators Assignment.
CS 3850 Lecture 5 Operators. 5.1 Binary Arithmetic Operators Binary arithmetic operators operate on two operands. Register and net (wire) operands are.
JavaScript, Third Edition
1 Expressions, Operators Expressions Operators and Precedence Reading for this class: L&L, 2.4.
Java Primitives The Smallest Building Blocks of the Language (corresponds with Chapter 2)
Exercises A-Declare a variable of double type with initial value=0.0; B- Declare a constant of String type with initial value=“Good” C- Declare a variable.
2440: 211 Interactive Web Programming Expressions & Operators.
Chapter 3: Data Types and Operators JavaScript - Introductory.
Chapter 2 Basic Elements of Java. Chapter Objectives Become familiar with the basic components of a Java program, including methods, special symbols,
Variables, Operators and Data Types. By Shyam Gurram.
Operators in Python. Arithmetic operators Some operators in Python will look familiar (+, -, *, /) Others are new to you (%, //, **) All of these do work.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
PHP Arūnas Liuiza. PHP 101 What is PHP? Widely popular dynamic interpreted opensource programming language, aimed for web development Syntax is simmilar.
Operators Precedence - Operators with the highest precedence will be executed first. Page 54 of the book and Appendix B list C's operator precedence. Parenthesis.
Boolean Logic Logical Operators Comparison Operators Truth tables.
PHY-102 SAPVariables and OperatorsSlide 1 Variables and Operators In this section we will learn how about variables in Java and basic operations one can.
CHAPTER 6 Introduction to PHP5 Part I อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
Arithmetic Expressions Addition (+) Subtraction (-) Multiplication (*) Division (/) –Integer –Real Number Mod Operator (%) Same as regular Depends on the.
Chapter Two Operators and Expressions Lesson Seven.
Doing math In java.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting PHP Basics.
OperatorstMyn1 Operators An operator is something that you feed with one or more values (or expressions, in programming jargon) which yields another value.
FP512 WEB PROGRAMMING 1 PREPARED BY: PN. NUR SYUHADA BINTI MOHAMAD.
 Arithmetic Operator :  Increment / Decrement Operator :  Assignment Operator :  Comparision Operator :  Logical Operator :  Ternary Operator : 
What is algorithm? the steps needed for a computer program to solve a given problem Using: Pseudo code Flow chart Or high level coding.
Java Programming: From Problem Analysis to Program Design, Second Edition 1 Lecture 1 Objectives  Become familiar with the basic components of a Java.
CHAPTER 2 PART #4 OPERATOR 1 st semester King Saud University College of Applied studies and Community Service Csc
Introduction to PHP and MySQL (Creating Database-Driven Websites)
ECE 103 Engineering Programming Chapter 4 Operators Herbert G. Mayer, PSU Status 6/10/2016 Initial content copied verbatim from ECE 103 material developed.
Chapter 3 Math Operations. Objectives Use the assignment and arithmetic operators. Use operators in output statements. Explain the problem with division.
PHP using MySQL Database for Web Development (part II)
>> Fundamental Concepts in PHP
VBScript Session 3.
CHAPTER 5 SERVER SIDE SCRIPTING
2.0 FUNDAMENTALS OF JAVA PROGRAMMING LANGUAGE
Operators Operators are symbols such as + (addition), - (subtraction), and * (multiplication). Operators do something with values. $foo = 25; $foo – 15;
Web Technologies PHP 5 Basic Language.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Overview: Programming Concepts
PHP Rasmus Lerdorf.
PHP Introduction.
Java Programming: From Problem Analysis to Program Design, 4e
Operators and Expressions
Arithmetic Operator Operation Example + addition x + y
Lecture 3 Expressions Richard Gesick.
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
Introduction to C++ Programming
Basics of ‘C’.
Chapter 2: Basic Elements of Java
Chapter 2 Variables.
PHP: Basics FdSc Module 109 Server side scripting and Database design
PHP.
C Operators, Operands, Expressions & Statements
Fundamentals 2.
elementary programming
Chapter 2: Java Fundamentals
Web Programming Language
Data Types and Expressions
Engineering Problem Solving with C++ An Object Based Approach
Engineering Problem Solving with C++ An Object Based Approach
Operators In Java Programming By Rajanikanth B.
PHP an introduction.
Operator King Saud University
5.03 Apply operators and Boolean expressions
Data Types and Expressions
Contact PSK Technologies Pvt. Ltd IT Company Address - Plot No-780, Near Durga Temple, Katol Road Chaoni, Nagpur-13.
Data Types and Expressions
Presentation transcript:

Algoritma & Pemrograman 1 Chapter 2 Achmad Fitro The Power of PowerPoint – thepopp.com

Basic PHP Basic Syntax Comment in PHP Case Sensitive

Basic Syntax Example <?php CODE HERE ?> <?php echo “helo teman-teman”; ?>

Comment Example // Or # /* statemen */ <?php // Ini komen satu baris # Ini juga /* Ini comment kalau beberapa baris */ ?>

Case Sensitive Example Huruf besar dan huruf kecil di bedakan dalam pemanggilan variable Example <?php $nama= “Bejo"; echo "My name is " . $nama. "<br>"; echo "My name is " . $Nama. "<br>"; echo "My name is " . $NAMA. "<br>"; ?>

PHP Variable A variable starts with the $ sign, followed by the name of the variable 5 Criteria A variable name must start with a letter or the underscore character A variable name cannot start with a number A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ ) case-sensitive

floating point numbers - also called double 7 Type Data PHP FLOAT Object floating point numbers - also called double STRING Boolean NULL Array INTEGER Prodi Teknik Komputer

PHP Operator Comparison Assignment Arithmetic String Array Logical Increment/Decrement String  Array 

Arithmetic Operator Name Example Result + Addition $x + $y Sum of $x and $y - Subtraction $x - $y Difference of $x and $y * Multiplication $x * $y Product of $x and $y / Division $x / $y Quotient of $x and $y % Modulus $x % $y Remainder of $x divided by $y

Assignment Assignment Same as... Description x = y The left operand gets set to the value of the expression on the right x += y x = x + y Addition x -= y x = x - y Subtraction x *= y x = x * y Multiplication x /= y x = x / y Division x %= y x = x % y Modulus

Comparison Operator Name Example Result == Equal $x == $y Returns true if $x is equal to $y != Not equal $x != $y Returns true if $x is not equal to $y <> $x <> $y > Greater than $x > $y Returns true if $x is greater than $y < Less than $x < $y Returns true if $x is less than $y >= Greater than or equal to $x >= $y Returns true if $x is greater than or equal to $y <= Less than or equal to $x <= $y Returns true if $x is less than or equal to $y

Increment / Decrement Operator Name Description ++$x Pre-increment Increments $x by one, then returns $x $x++ Post-increment Returns $x, then increments $x by one --$x Pre-decrement Decrements $x by one, then returns $x $x-- Post-decrement Returns $x, then decrements $x by one

Logical Operator Name Example Result and And $x and $y True if both $x and $y are true or Or $x or $y True if either $x or $y is true xor Xor $x xor $y True if either $x or $y is true, but not both && $x && $y || $x || $y ! Not !$x True if $x is not true

String Operator Name Example Result . Concatenation $txt1 . $txt2 Concatenation of $txt1 and $txt2 .= Concatenation assignment $txt1 .= $txt2 Appends $txt2 to $txt1

Array Operator Name Example Result + Union $x + $y Union of $x and $y == Equality $x == $y Returns true if $x and $y have the same key/value pairs != Inequality $x != $y Returns true if $x is not equal to $y <> $x <> $y

Thank You for Watching! Any Questions?