SUNY Geneseo Department of Computer Science
Friday, January 31
CSci 120, Spring 2014
Prof. Doug Baldwin
Quiz
“License” error: Only 30 people can use Matlab concurrently at Geneseo, error on launch means you’re the 31st.
TA office hours
Handout for today & Monday / Wednesday lesson
± for quadratic equation?
Or (||
) vs exclusive or (exor
)?
p || q
, exor(p,q)
roughly equivalent to English “p or q”p || q
is trueexor(p,q)
is falseQuestion 1
x = 2 ^ 3 / 4
means set x equal to 23 ÷ 4, i.e., 8 ÷ 4, i.e., 2y = 1 + 3 * 2
means set y equal to 1 + 3 × 2, i.e., 1 + 6, i.e., 7x = y
means set x equal to the value of y, so x ends up equal to 7 (and y is still equal to 7 too)Question 2
x == 0
compares x to 0, i.e., asks the question “is x equal to 0”?x = 0
sets x equal to 0, i.e., changes the value of x0 = x
is an error (assignments must have a variable on the left side of the =
)0 ~= x
asks the question “is x not equal to 0”?