Conditionals 2 - nesting and elseif


examples


Classwork

In a text document:

Write pseudocode for the following situations.  Think about input, including variable names and types; prompt the user for input and only ask for input from the user if it is needed.

  1. If the user wants the meal deal they get drink and fries automatically and their cost is $5, otherwise, their cost is $3 but then we should check if they want to add a drink (costs an extra $2) and if they want fries (costs an extra $3). At the end tell them their total cost
  2. Get the user's age and then tell them the price of their ticket: children under 12 cost $5, teens up to 18 cost $8, adults cost $15, but seniors over 60 cost $10.