Lab Homework 3
Flow and Function
- Update your cheat sheet to include the new program flow operations we’ve learned. Include examples and syntax comments (whatever helps you) for the following:
- If statements
- Else statements
- Switch
- For Loop
- Write a program that outputs the following to the console:
#
###
#####
#######
2. You noticed that people who enter the coffee shop holding their phones tend to get their drinks faster. Create a function that could help you estimate the time it would take someone to get their drink based on two boolean variables: holdingPhone and isAlone the output of the program should be in the form of:
Estimated drink time: 1.2 minutes
Where 1.2 above is calculated by your program.
Note: Don’t be ashamed to do what most programmers do (go to www.stackoverflow.com) if you need help or inspiration