If you pay attention while taking notes, you should be able to write down everything the speaker says.
hypothesis
A conditional statement may or may not be true.
The standard syntax is:if( conditional_expression )statement;[[else if( conditional_expression )statement;[else if...]]else statement;][] denotes optional components. Each statement may be a single statement, or may be multiple statements surrounded by braces {}.The if( conditional expression ) statement; is the only required component. In plain English, this reads: if the conditional expression is true, then execute the following statement, otherwise skip to the line following the statement.If the next line is an else statement, then the line reads: if the conditional expression is true, then execute the statement and skip over the else statement. But if the conditional expression is false, then skip over the statement and execute the else statement instead.if( conditional_expression )statement; // execute when conditional expression is trueelsestatement; // execute when conditional expression is falseThe statement following the else can be another ifstatement (a nested if):if( conditional_expression_1 )statement; // execute when conditional_expression_1 is true.else if( conditional_expression_2)statement; // execute when conditional_expression_1 is false and _2 is true.elsestatement; // execute when both _1 and _2 are both false.Note that if an else statement is used without a following if statement, it must appear after all other else if statements.
The part of a conditional statement following the word "then" is the consequent. It is the action or outcome that will occur if the condition specified in the statement is met.
hypothesis
The law of syllogism is a logical rule that lets you draw a conclusion from two conditional statements. If the first statement leads to the second statement and the second statement leads to a third statement, you can infer that the first statement leads to the third statement. It's a way to combine multiple conditional statements to draw a single conclusion.
x
Statements that check an expression then may or may not execute a statement or group of statements depending on the result of the condition.
Selection statement: if, switch/case, ternary conditional operator.
if(condition) { statements /* ... */ }
The method of the if...else statement allows you to combine related conditional statements. This statement provides a way to execute different blocks of code based on whether a specified condition is true or false.
Disjunction
Given that an integer is the same as a whole number, there are four true conditional statements.