Project

Simple Calculator

Medium
234 completions
~ 8 hours
4.2

Get more familiar with basic bash commands. Work with variables, the user input, arithmetic operators, conditional statements, functions, arrays, regex, and the bc utility, which stands for Basic Calculator.

Provided by

JetBrains Academy JetBrains Academy

About

A long time ago ancient people used fingers to calculate. Of course, this method had certain limitations. The abacus was invented to fill in the gap. Four hundred years ago, Wilhelm Schickard, a German astronomer, invented one of the first calculating machines. Another inventor, Thomas de Colmar, created Arithmometer in 1820. It was the first commercial calculator. We are very lucky, though. We got bash to do calculations. In this project, you will learn to create a simple calculator with bash.

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:
Learn how to carry out simple arithmetic operations in bash.
Let's turn to more complex arithmetic operations and learn how to handle the bc utility.
Add more functionality to your program. Welcome users and ask whether they want to quit or do some calculations. Also, save the calculation history into a file.

Reviews

Kheng-Bee Goh
2 months ago
Fun project that puts to practice stdin, stdout and basic file operation in combination with interactive input.
Kenneth Satterlee
3 months ago
Great project that taught me more about the basic calculator tool. I learned more about the tee tool to display stdout on the console and append into a log file
Klekovkina Alena avatar
Klekovkina Alena
1 year ago
This project teaches how to build an interactive terminal application that prompts the user, processes input, and exits gracefully with commands like "quit". It introduces input validation using regular expressions, arithmetic using external tools like bc, and file handling for logging. You'll also ...

4.2

Learners who completed this project within the Introduction to Command Line and Unix Shell course rated it as follows:
Usefulness
4.3
Fun
4.1
Clarity
4.1