What is the difference between and if and and if-else statement?
An if then statement tells the program to do x if y happens and an if-then-else statement tells the program to do x if y happens and z if y does not happen.
Is there a simpler way to write the following code? Explain.
The else is unnesescary. The code only needs and if-then statement.
Which students are described by the following conditional? “if you are not a Senior and you are on the soccer team or you are in band then…”
The students described are non-seniors who play soccer or play in the band.
If the statement from Question 3 is changed as shown below, who else is included in the condition? if you are not a Senior OR you are on the soccer team or you are in band then…”
It describes students who are not seniors or play soccer or play in the band.
Click HERE to return to homepage.