Chapter 3 Conditions Flashcards
What is a good general practice to add to ending braces?
Add a comment to denote what the end brace is used for
What are three common operators found in Boolean algebra and what values do they manipulate?
“And”, “or”, and “not” are used to manipulate the values “true” and “false”.
What are three common operators found in Boolean algebra?
And
Or
Not
Who is Boolean algebra named after?
George Boole, a nineteenth-century English mathematician.
When using the “and” operator, what is required for the compound condition (entire expression) to be true?
Both sides of the “and” operator must be true
Ex.: 3==3 and 4==4 is true
When using the “or” operator, what is required for the compound condition (entire expression) to be true?
At least one side of the “or” operator must be true
Ex.: 3==3 or 3==4 is true
How does the C programming language treat all nonzero and zero values?
All nonzero values are treated as true while all zero values are treated as false.
What character set represents the “and” Boolean operator?
&& (two ampersands)
What library is the “isdigit ()” function a part of?
The library.
What library is the “isdigit ()” function a part of?
What is the “switch (x)” structure used for?
When programmers want to evaluate a user’s response to a specific set of choices.
Ex.: When a user selects an item from a menu.
What are three common operators found in Boolean algebra?
And
Or
Not
Who is Boolean algebra named after?
George Boole, a nineteenth-century English mathematician.
When using the “and” operator, what is required for the compound condition (entire expression) to be true?
Both sides of the “and” operator must be true
Ex.: 3==3 and 4==4 is true
What is the “srand ()” function used for?
The “srand ()” function seeds a variable into the rand () function to dictate the random number generator algorithm.