Lab Write Up

Name: Elijah Levy

Period: 7

Assignment: Lab 6

Lab Overview

This lab focused on conditionals

Questions

  1. What is the difference between an "if" and "if-else" statement?
    • An "if" statement does nothing if the conditions aren't met, while an else statement has an alternate outcome.
  2. Is there a simpler way to write the code?
    • The move command can be placed outside the "if" statement.
  3. 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 statement describes Senior soccer players and band members.
  4. 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…”
    • This statement describes, all seniors, all soccer players, and all band members.
  5. Write the condition for a number being a multiple of 15.
    • if (x mod 15 == 0)