Project
Smart Calculator (Go)
Challenging
86 completions
~ 12 hours
4.3Apart from writing a useful program (everyone uses calculators!), you will learn a lot about slices, strings, and maps. You will also get a 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 Go Developer 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 using a for loop until the user enters "exit".
Using slices and strings, make it possible to calculate sums of multiple integers.
Where there is a plus, there is a minus. Using your knowledge of slices 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 maps, enable the calculator to use variables.
Time to upgrade and add even more possible operations: multiplication, division, powers, and calculations in parentheses.
Reviews
AP
Alexandr Primak3 months ago
Interesting project, learned a lot about converting infix to postfix, hopefully this will be useful to me in the future.
I learned how to build a calculator program in Go that handles variables and mathematical expressions with operator precedence. I implemented support for basic arithmetic operations (+, -, *, /, ^), parentheses, and variable assignments. The calculator processes input line by line, recognizing comma ...
I have learned how to implement a basic calculator in Go that supports arithmetic operations, variable assignments, and case-sensitive variable handling. I also gained experience in converting infix expressions to postfix notation and evaluating them. Additionally, I learned how to handle user input ...
4.3
Learners who completed this project within the Go Developer course rated it as follows: