To open any link in a new tab, preserving your position in the current article, just hold down the <CTRL> key on your keyboard before clicking the link or click using your mouse wheel.

Possible errors when writing an IF - THEN Statement

Incorrect result when writing a mathematical reasoning if-then statement between numbers properties


Issue:  Using a pair of apostrophes while mathematically comparing two numbers.

 

Fix:      When writing a logical mathematical reasoning between numbers only, don't express properties in a pair of apostrophes. A pair of apostrophes is used to express strings or texts only.


Example 1: Test 1 property is the CORRECT way of writing an if-then statement's mathematical comparison between two numbers only properties. Texts results are displayed inside a pair of apostrophes.




Example 2: Test property gives an INCORRECT result. The if-then statement with apostrophes understands the result of property a : 7 (ONE text/string) and compares it with the result of property b : 6 instead of the whole number 60 (TWO texts/strings).



Example 3: Test property gives a CORRECT result. The if-then statement with apostrophes understands the result of property a : 17 (TWO texts/strings) and compares it with the result of property b : 60 (TWO texts/strings).


Copyright 2023 ConstructConnect