Project

Coffee Machine (Scala)

38 completions
~ 6 hours
4.2

This project allows you to better understand the basic OOP, its main concepts such as classes, class methods and attributes, and get a taste of Scala. Practice working with functions, challenge yourself with loops and conditions, and get more confident with OOP.

Provided by

JetBrains Academy JetBrains Academy

About

What can be better than a cup of coffee during a break? A coffee that you don’t have to make yourself. It’s enough to press a couple of buttons on the machine and you get a cup of energy; but first, we should teach the machine how to do it. In this project, you will work on programming a coffee machine simulator. The machine works with typical products: coffee, milk, sugar, and plastic cups; if it runs out of something, it shows a notification. You can get three types of coffee: espresso, cappuccino and latte. Since nothing’s for free, it also collects the money.

Training project icon

Training project

This project allows you to practice and strengthen your coding skills, helping you get ready for more advanced tasks ahead.

What you'll learn

Once you choose a project, we'll provide you with a study plan that includes all the necessary topics from your course to get it built. Here’s what awaits you:
Program the machine to calculate the amount of ingredients it needs depending on how many people want some coffee.
Working with conditions, program the machine to estimate how many creamy coffees it can make based on the amount of ingredients we enter.
Teach your virtual coffee machine to perform three basic actions: collect the money, renew the supplies, and serve the coffee.
Program the machine to display on the screen the amount of supplies left. Set the main loop: now the menu keeps updating until you enter “exit”.
Time for some final touch-ups: structure the code so that it runs smoothly.

Reviews

Ivan Prokhorov avatar
Ivan Prokhorov
3 years ago
variables, values, and so on in Scala were described during the project, but quite strange classes were not, and in the last stage it is demanded to refactor the ready code with classes. So I somehow refactored it and got a vague understanding what classes in Scala are (here some basic knowledge of ...
Ekaterina Kozlova
3 years ago
It's a nice project to start with Scala. I learned bacis about this language and wrote first lines of code. As for the hole track - it seems like it haven't decide either its for the complete nubies in programming or for those how already know another language. Sometimes it explains why do we need ...
Nicolas May
3 years ago
The lessons (theory + practice) that are included for this project are pretty good. But I get the impression that quite a bit of the overall project is too general and doesn't provide enough Scala- and functional programming-specific guidance. This is especially true of the project stages (1-6). The ...

4.2

Learners who completed this project within the course rated it as follows:
Usefulness
4.2
Fun
4.3
Clarity
4.2