Conditionals 4 - case/switch, deMorgan


examples


Classwork

In a text document:

For each, think about input, including variable names and types; prompt the user for input.

  1. The bank requires that you keep at least $500 in your account and use electronic statements, or you must pay a $5 monthly fee. 
    1. Write a single if to check if there is no fee, and if so print a message saying so
    2. Write a single if to check the opposite, and if so show their new balance with the fee deducted.
  2. The safe range for blood sugar is between 55 and 90.  
    1. Write a single if to check if the patient is safe, and if so print a message
    2. Write a single if to check the opposite, and print if the patient is in danger.
  3. Get the user's meal choice and tell them their price. Menu options are:

    1.  Burger with fries $5 

    2.  Spaghetti with salad $7

    3.  Meatball sub $6

    4.  Vegetable casserole $4.