
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
10 questions
Parallel and perpendicular slope
Presentation
•
9th Grade
6 questions
Robotics Guide
Presentation
•
8th Grade
6 questions
Punctuating dialogue
Presentation
•
9th Grade
7 questions
Знаходження мінімального та максимального значення списку
Presentation
•
9th Grade
9 questions
DESAFIO_PROVAPR_9_EF_HIST_001
Presentation
•
9th Grade
9 questions
Diffusion
Presentation
•
9th Grade
10 questions
Spread of the Cold War - Vietnam War
Presentation
•
9th Grade
10 questions
The Discriminant
Presentation
•
9th Grade
Popular Resources on Wayground
20 questions
Math Review
Quiz
•
3rd Grade
15 questions
Fast food
Quiz
•
7th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
10 questions
Identify Fractions, Mixed Numbers & Improper Fractions
Quiz
•
3rd - 4th Grade
Discover more resources for Computers
10 questions
Fact Check Ice Breaker: Two truths and a lie
Quiz
•
5th - 12th Grade
10 questions
Video Games
Quiz
•
6th - 12th Grade
10 questions
Logos
Quiz
•
6th - 9th Grade
10 questions
Test Your Knowledge with 15 Fun Trivia Questions
Interactive video
•
6th - 10th Grade
15 questions
Memorial Day Trivia
Quiz
•
KG - 12th Grade
21 questions
Factoring Trinomials (a=1)
Quiz
•
9th Grade
12 questions
Name that Candy
Quiz
•
KG - 12th Grade
20 questions
Guess The App
Quiz
•
KG - Professional Dev...