Project
Smart Calculator (Kotlin)
Hard
1115 completions
~ 24 hours
4.3Apart 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
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.
Graduate project
This project covers the core topics of the Kotlin Core course, making it sufficiently challenging to be a proud addition to your portfolio.
At least one graduate project is required to complete the course.
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:
Your calculator is taking its first steps: teach it to calculate the sum of two integers and display the result on the screen.
Enable your calculator to keep adding numbers in a loop until the user enters “exit”.
Using lists and strings, make it possible to calculate sums of multiple integers.
Where there is a plus, there is a minus. Using your knowledge of lists 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.
Get to know BigInterger class in order to manipulate big, large, long integers in calculations.
Reviews
2 days ago
I learned to build a resilient Kotlin smart calculator by normalizing operator runs, tokenizing numbers/identifiers/parentheses, distinguishing unary ±, converting infix to postfix with the shunting‑yard algorithm, and evaluating using BigInteger with variables and assignments.
Nikita Bolsunovsky
4 weeks ago
Syntax, conditional constructs, classes, objects and so on. Also, infix/postfix conversion was interesting.
4.3
Learners who completed this project within the Kotlin Core course rated it as follows: