Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculator

General information: Code can only preform mathimatical operations with two numbers. Mathematical actions are limited to addition, subtraction, multiplication and division.

  1. Asks the user to enter the first number.
  2. Tries to turn that input into an integer. If it fails (e.g., user types “abc”), it prints “Invalid input.”
  3. Asks the user which operation they want (+, -, *, or /). If the choice is not one of these, it prints “Invalid input.”
  4. Asks the user to enter the second number.
  5. Tries to turn that into an integer. If it fails, it prints “Invalid input.”
  6. If the action is valid, performs the chosen math operation: addition, subtraction, multiplication, or division.
  7. If division is chosen and the second number is 0, it warns “Division by zero is not possible.”
  8. Displays the result of the calculation in the terminal.

About

Code that acts as a calculator

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages