Project

Smart Calculator (Scala)

22 completions
~ 7 hours
4.5

Apart from writing a useful program (everyone uses calculators!), you will learn a lot about lists, strings, and other data types. You will also get closer experience with 2 important data structures: the stack and the queue.

Provided by

JetBrains Academy JetBrains Academy

About

Calculators are a very helpful tool that we all use on a regular basis. Why not create one yourself, and make it really special? In this project, you will write a calculator that not only adds, subtracts, and multiplies, but is also smart enough to remember your previous calculations.

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:
Enable your calculator to keep adding numbers in a loop until the user enters “exit”.
Using arrays and strings, make it possible to calculate sums of multiple integers.
Where there is a plus, there is a minus. Using your knowledge of arrays and strings, enable the calculator to deal with subtraction as well as addition.
There’s no math without errors: teach your program to alert the user to errors in the case of invalid input.
Working with Map class, enable the calculator to use variables.
Time to upgrade and add even more possible operations: multiplication, division, powers, and calculations in parentheses.

Reviews

Michael Short avatar
Michael Short
2 years ago
I learned about postfix notation, and the importance of accounting for corner cases (absolutely rife in this project). Also that writing Scala like a sort of Frankenstein's monster of Java and Python is a bad idea.
Machkour Oke avatar
Machkour Oke
3 years ago
Moderator
I learned a lot of basic scala functionality while building on a solid project. However the version of scala used for tests and courses must be updated
ÇAĞRI KURT avatar
ÇAĞRI KURT
4 years ago
It provides a lot of useful structures like stacks, arrays and operations with them. I really liked the project.

4.5

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