Comp Sci Ch 3 Ch 4 Flashcards
What is a branch and when is it executed?
and if statement executed under a certain condition
What is an if-else branch and when is it executed?
2 branches
if branch executed if true, then else is executed if false
What is an if-else-if-else branch?
each branch is checked until one is found to be true
In a conditional expression you use…
==, and relational operators
What is a bool value?
True or False
How are characters compared?
with their ASCII
How are strings compared?
same number of characters and if their characters are identical
What are the logical operators
&&, ||, !
How to compare floating point numbers?
fabs (x-y) < .0001
What is epsilon?
the difference threshold that floating point numbers are equal
How do you get a random number?
rand()
What needs to be enabled to use rand()
(#) include < cstdlib >
How do you get a specific range of random numbers?
rand() % (largest-smallest +1) + smallest
How do you determine number values in range of randomization coputation
large-small +1
What is pseudo?
not actually but having the appearance of