‹header›
‹date/time›
Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level
‹footer›
‹#›
After today’s class you will have seen all the elements needed to write this program. Basic mathematical operators, the “if” control structure, input and output, the sqrt() function.
Basically we saw how to use C++ can be used as a calculator.
After today’s class you will have seen all the elements needed to write this program. Basic mathematical operators, the “if” control structure, input and output, the sqrt() function.
After today’s class you will have seen all the elements needed to write this program. Basic mathematical operators, the “if” control structure, input and output, the sqrt() function.
After today’s class you will have seen all the elements needed to write this program. Basic mathematical operators, the “if” control structure, input and output, the sqrt() function.
After today’s class you will have seen all the elements needed to write this program. Basic mathematical operators, the “if” control structure, input and output, the sqrt() function.
Nesting if statements is the same as “anding” the boolean expressions if the nested if is the only statement between the braces
After today’s class you will have seen all the elements needed to write this program. Basic mathematical operators, the “if” control structure, input and output, the sqrt() function.
After today’s class you will have seen all the elements needed to write this program. Basic mathematical operators, the “if” control structure, input and output, the sqrt() function.
Fixed a typo – originally I had (y % 2) == 0 instead of (x % 2) == 0
As soon as the program finds one of the boolean expressions to be true is executes the associated block of code and skips past the whole rest of the if … else block.
As soon as the program finds one of the boolean expressions to be true is executes the associated block of code and skips past the whole rest of the if … else block.
As soon as the program finds one of the boolean expressions to be true is executes the associated block of code and skips past the whole rest of the if … else block.
As soon as the program finds one of the boolean expressions to be true is executes the associated block of code and skips past the whole rest of the if … else block.
As soon as the program finds one of the boolean expressions to be true is executes the associated block of code and skips past the whole rest of the if … else block.
After today’s class you will have seen all the elements needed to write this program. Basic mathematical operators, the “if” control structure, input and output, the sqrt() function.
After today’s class you will have seen all the elements needed to write this program. Basic mathematical operators, the “if” control structure, input and output, the sqrt() function.
The previous code had a bug – it has been corrected. (It said ( x/( sqrt( discriminant ) )  = =  sqrt( discriminant ) ) )
Only worked for numbers with many decimal places in their roots
You can’t take the sqrt of a negative so we have to change it into a positive number