...

/

Simple Calculator to Perform Addition

Simple Calculator to Perform Addition

Learn about string interpolation and using of variables to perform mathematical operations.

Problem

Develop a simple calculator that adds two integers (up to 99) from user inputs and prints out the sum.

I am an adding machine, and I am good at it.
Enter first number: (type 1, press Enter)
Enter second number: (type 99, press Enter)
Thinking ...
Got it, the answer is: 100
Demo of a simple calculator

Purpose

  • Read a user’s keyboard input

  • Use variables for mathematic operations ...