
Testing Lesson
Presentation
•
Computers
•
9th Grade
•
Practice Problem
•
Hard
Julie Rhoades
Used 2+ times
FREE Resource
8 Slides • 0 Questions
1
M2 L1 PHP
2
Overview
Use conditional statements
if
if...else
switch
Nested statements
2
3
if Statements
Syntax for a simple if statement is:
if (conditional expression)
statement;
If more than 1 statement, they must be in
a block { }
Recommendation: Always include { } to
cut down on errors
3
Indent
for readability
and less errors
4
if Statements, Example
$ExampleVar = 5;
if ($ExampleVar == 5) {
echo "<p>Evaluated to true.</p>";
echo "<p>So these lines print.</p>”;
}
echo "<p>This statement always executes.</p>";
4
Opening and Closing braces.
Needed for a command block
5
if...else Statements
Syntax:
if (conditional expression)
statement;
else
statement;
Example:
$Today = "Tuesday";
if ($Today == "Monday") {
echo "<p>Today is Monday</p>";
}
Else {
echo "<p>Today is not Monday</p>";
}
5
6
Nested Statements
One decision-making statement is
contained within another
$SalesTotal = 60;
if ($SalesTotal > 50){
if ($SalesTotal < 100){
echo "<p>Sales between 50 & 100.</p>";
}
}
6
7
switch Statements
$AmericanCity = "Chicago";
switch ($AmericanCity) {
case "Miami":
Echo "Florida";
break;
case "Chicago":
Echo "Illinois";
break;
case "Los Angeles":
Echo "California";
break;
default:
Echo "United States";
}
7
Break command ends a switch
statement. Needed because
the switch statement does not
automatically stop after a case
match.
Expression
Case Label and value
Default – if no
match above
8
Summary
Use conditional statements
if
if...else
switch
Nested statements
8
M2 L1 PHP
Show answer
Auto Play
Slide 1 / 8
SLIDE
Similar Resources on Wayground
9 questions
Half Life
Presentation
•
9th Grade
4 questions
JFS G8 Decomposition
Presentation
•
9th Grade
7 questions
Descritores de Língua Portuguesa
Presentation
•
9th Grade
6 questions
Writing Equations
Presentation
•
8th Grade
7 questions
8.2 Solving Cube Root Equations
Presentation
•
9th Grade
6 questions
APCSP Unit 5 Review
Presentation
•
10th Grade
7 questions
Pseudocode assessment
Presentation
•
9th Grade
7 questions
3a1.Prokaryote vs Eukaryote
Presentation
•
9th - 10th Grade
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade