App Lab — Part 1
Pseudo Code

Introduction:
CoffeeTawk is a program designed to improve the coffee (or tea, or fru-fru drink) experience for customers of insert large coffee brand here. Each student and team in the course will design their own version of CoffeeTawk based on real-world observations and testing, incorporating user feedback, analytics and ideas from others.
The application we’re building during the next 5 labs will be built in phases that not only allow you to practice the programming concepts we cover in the programming lab, but also to complement the work you’re doing on the business side.
In lab 01, we covered the basics of Javascript, including primitive values (numbers, booleans, strings), operators (such as < > <= >= === !==and != ). Logical operators (&& || and ! ), bindings to values and program flow.
You’re not crazy, that is a lot of material. Don’t worry, we’ll get to review a few more times.
Our App
Recall what you read in the email from the NYU Shanghai alum: https://medium.com/applab/coffee-tawk-activity-one-6e3d693a188b
Take a look at her email again. Note how many assumptions she’s making:
I feel like we have a larger demand here in Shanghai, but our stores just don’t operate as efficiently. The lines are long, it can take up to a minute or more just to take an order, and another 5 minutes for them to walk out the door with their beverage. Payment is quick, most people use AliPay or WeChat Pay. The order-taking process is slow, our baristas are fast, but they struggle to keep up with making drinks and handling customer questions. I’m struggling to figure out how to improve our sales, and I’m sure it’s through some combination of technology and operational efficiencies. I think most people know what they want before they even walk in the store, but there are still a lot of people that just stand at the register asking questions and holding up the line. What about the people who just want to walk in, grab their drink and go. I think we’re losing that business.
The entire statement is is full of assumptions, some large, some small, but many of the them should be verifiable with the right approach. One approach you’ll take is to sit in a store and observe. This is a useful approach, and it’s very accessible. Another approach you’ll take is to build an application to validate some of these assumptions, and hopefully to uncover other avenues to make their business better.
Instructions:
In this homework activity, you’ll be tasked to put basic programming concepts together to create a program to help you do some more quantitative research in the next business lab (where you’ll be asked to go outside and sit in a real coffee shop and observe). We want to make a program that will help us by performing quick performance metric calculations (customers / hour) and (average wait time) based on the information we give it.
Project Setup
Follow the steps below to set up your project. You’ll be using this repository from the next 5 labs as we build up our application.
- Create a new folder named
applaband initialize it as an empty git repository - Create a new folder called
coffeetawk - Create a
coffeetawk.jsfile incoffeetawk/and add the following comment://CoffeeTawk — by 'your name here' — applab, lab 1, 2018 - Now, add your file to source control
git add . - Create a new Github.com repository called
Coffeetawk - Push your
coffeetawk.jsfile to your Github.com repository (check earlier guides if you need a refresher)
Challenge 1:
We’re going to build a few programs to help measure some of the assumptions that Huihui gave us. Let’s break them down and decide on an approach(there are a lot):
Take the email from Huihui and break out each assumption. Do this for every specific assumption that you identify (some will be too broad, so use your best judgement). Below are the first 3 that I found.
The lines are long, It can take up to a minute or more just to take an order, and another 5 minutes for them to walk out the door with their beverage. ...
Challenge 2:
Now that you have the assumptions broken out. Start to think like a programmer. Using the programming concepts from the first lab, write pseudocode to help you approach how to write a program to validate or invalidate as many assumptions as possible.
Give some consideration to how your program might be used in reality. Imagine your program running on its own, with input from a variety of sources (perhaps even a computer vision algorithm that uses a camera to measure waiting times, and input from the register to help track when an order is entered). While you don’t need to add these features to your pseudocode, you can still use this line of thinking to approach your program.
- Try and be as specific as possible, general statements like measure the length of the line are not as good as specific ones such as each 10 seconds, count the total number of people in line.
- Think in terms of activities that take place within a coffee shop and try and group assumptions together with the goal of simplifying your code. For example, you can group the code that helps validate the order-taking process is slow and it can take a minute or more just to take an order together (there are more assumptions that can be grouped!).
- save this as
coffeetawk.js, add a commit message and submit to Github.com
Challenge 3:
Using the same coffeetawk.js pseudocode file, create a simple program that returns a useful value. You may use sample bindings and values (such as a number for line length). Check out the lab recap for ideas.
As an example, it’s important to measure the total time between standing in line and receiving your order, but the type of order and quantity will obviously have a big impact. You might choose to write a program with a string called drinkType and number for quantity, which outputs a number representing the average time to make the drink according to a statistic, and compares that to the actual time it took the barista — this code could help you validate the assumption that our baristas are fast.
Remember that your ultimate goal is to begin the work of writing a program to help validate many of the assumptions present in her initial email, and even to use this to suggest ways to improve their operations, service and business in general!
- run this program and ensure it works.
- save this file, add a commit message and submit it to your
coffeetawkrepo on Github.com. - post a link to your Github repository on the #lab-1 channel on Slack.

