CS 1410 Lecture Notes - Lecture 3: Boolean Expression

30 views2 pages

Document Summary

If using an integer variable, the decimals are dropped (not rounded) Character a : single quotes for single letters, a + 1 = 66. A is converted to unicode representation (65) when used in a calculation: (char) ( a + 1) = b . Result of calculation is converted to the type in parenthesis. Booleans cannot be converted: only hold true or false (lower case, boolean issnowing; issnowing = false; Flags: testing a program, boolean didpass = score >= 70; Tests objects to see if they are the same object: objects (such as strings) can only be tested for equality, (x >= 5) && (x <= 10) && is and (both expressions must be true for the boolean to be true) || is or (only one of the expression must be true for the boolean to be set to true) Not (if true, boolean is set to false; if false, boolean is set to true)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents