Conditionals 1 - 'if'
Duration: 53:53
Created with
Ben Fhala
Ben Fhala is the creative force and founder behind 02geek, a pioneering platform dedicated to making web development accessible to everyone. With over 18 years of experience in the industry, Ben has a deep passion for teaching and a knack for breaking down complex concepts into easy-to-understand lessons.
Conditionals 1 - 'if' Overview
What you'll learn
Computers have to be programmed in order to perform tasks and make decisions according to the user'sexpectations. In this course, we will focus on the decision-making part of programs. Programing languages provide constructs, and both logical and comparison operators. Results of computation can then be compared, combined and tested to implement branching (branching is a simple concept that sounds scary as do most programing terms! Take the 'if' construct: %u201CIf the dog needs to go out, let him out. Else he will pee on the floor.%u201D The dog's need to go out, being let out and the events that follow are one branch of this 'if'; the other is the dog being ignored, and the consequences that ensue.)
Ready to Level Up Your Skills?
Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!
Enroll Now for Free!Overview
We will learn about various conditionals related to ‘if’. The main focus is on the importance of brackets and conditionals such as if/else, if/else if…, nested if, if not etc.
Conditionals and Operators
Greater than the tutorials you'll find elsewhere, 02geek takes less time to teach how logical operators are directly linked to conditionals, and how conditional expressions can be formed using these o
if
We introduce the “if†construct and show how it can be used for making programming decisions while implementing the program logic
Brackets
We explain the importance of using brackets with if, mainly to combine a sequence of operations, all to be performed on the same condition
else
We introduce the language mechanism for providing alternatives in code; ie,. to make decisions when we have 2 options
Else-if: dealing with multiple conditions
We introduce the else-if construct, to help make logic decisions when more than 2 options are available
Nested if conditional construct
We introduce the nested if construct, useful when there are more than one criteria of decision making, including one inside another
Nested if’s – The Answer
We introduce another approach to nested if’s organization: mainly inverting the nesting levels of if constructs
Say it ain't so – the “If-Not†conditional
We introduce how to reorganize condition checking code using if constructs having Not (!) operators in the conditionals
Ready to Level Up Your Skills?
Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!
Enroll Now for Free!