Lab Homework 3

Flow and Function

Christian Grewell
applab 2.0
1 min readFeb 9, 2019

--

Photo by Laurent Naville on Unsplash
  1. 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

--

--

Christian Grewell
applab 2.0

Hi! My name is Christian Grewell, I grew up in Portland, Oregon playing music, programming video games, building computers and drinking coffee. I live in China.