Coffee Time application

{list, loops (optional), conditions}

You are going to develop one of the most important and crucial applications for the hitech.

Prehistory. The best hi-tech companies in Israel and in the whole world are very interested in satisfying their employees. One of the best ways to do it is to bring a great coffee to the company. Some sophisticated companies are hiring baristas for a full time job.

So, currently all the hi-tech employees are suffering from a variety of coffee choices.

You are going to solve this problem for them.

You are going to build an application that receives a time of the day and and the number of friends who will drink the coffee together, and returns the type of coffee your hi-tech employees are going to drink according to the logic explained bellow.

Types of coffee: 24 types (see the attached image)

Use Case for the explanation:

The flow of the app:

  1. User enters the time when he wants to drink a coffee in 24h format. (Ex: 14:03)
  2. User enters the number of employees who are going to have a coffee with him. If the user is alone - the input should be equal to 1.
  3. The app should return the coffee name according to:
  1. The first user should have a coffee number according to the hour that user entered. In our example (14:03) ⇒ user #1 should have a coffee #14, which is (from left to right and from top to bottom) = “MOCHA”
  2. The every next friend that comes to have a coffee with user #1 (in our use case there are additional 2 friends)
  1. Having the coffee number of the previous user + number of minutes that user #1 entered.
  1. Friend #2 will order the coffee number #14 + 3 = #17 (“RAF COFFEE”)
  2. Friend #3 will order the coffee number #14+3+3 = #20 (“CHOCOLATE MILK”)
  1. If you reach the end of the coffee list when adding numbers, continue from the beginning of the list. For example, for the input:

Time: 14:40 and Friends: 2, you should display:

Coffee #14 (MOCHA), and coffee #26 (Cappuccino Freddo).

Coffee #26 was calculated as follows: 14 + 40 = 54 (we got further than the end of the list). We have a total of 28 items in the list, so 54 % 28 = 26 - this is the number we are looking for.

Notes:

  1. Start from solving the easier case of this question that does not require using loops. Assume that the number of friends is limited to a maximum of two.
  2. After you finish the easier version of the exercise, try implementing the original version that allows you to insert any number of friends. This will require using loops!
  3. Make sure to validate user inputs!

BONUS #1

  1. The user can enter the starting number, let’s say user entered number 2 ⇒ so the user #1 , which entered the time 14:12 will have a coffee #14+2 = #16 (“BREVE”)

BONUS #2

  1. Users can enter the list of the coffee numbers that should be excluded from this iteration.

Inputs and expected outputs:

Expected output: ☕ numbers: #11 (CAFFE LATTE), #5 (MACCHIANTO), #27 (CARAMEL FRAPPE), #21(LATTE MACCHIATO)

Expected output: ☕ numbers: #9 (CAPPUCCINO), #9 (CAPPUCCINO)

Expected output: ☕ numbers: #18 (MEAD RAF), #24 (IRISH COFFEE)