Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Calculator Plus

Welcome to My Calculator! This simple calculator program allows you to perform basic arithmetic operations such as addition, subtraction, multiplication, and division.

Features

  • User-Friendly Interface: The program provides a clear menu for selecting operations.
  • Basic Arithmetic Operations: You can add, subtract, multiply, and divide two numbers.
  • Error Handling: The program handles invalid input and division by zero gracefully.
  • Continuation Prompt: Users can choose to perform additional calculations or exit the program.

Getting Started

Prerequisites

  • Python 3 installed on your machine.

Running the Calculator

  1. Clone the repository or copy the code into a Python file (e.g., main.py).
  2. Open your terminal or command prompt.
  3. Navigate to the directory where your Python file is located.
  4. Run the program using the command:
    python calculator.py

Usage

  1. When you run the program, you will be welcomed and presented with a menu of options.
  2. Enter your choice (1-5) to perform an operation or exit.
  3. If you choose to perform an operation, you will be prompted to enter two numbers.
  4. The program will display the result of the calculation.
  5. You can then choose to continue using the calculator or exit.

Example Output

Welcome to Muhais' Calculator!
Simple Calculator
1. Add
2. Subtract
3. Multiply
4. Divide
5. Exit
Enter your choice (1-5): 1
Enter the first number: 10
Enter the second number: 5
Addition Result: 10.0 + 5.0 = 15.00
Do you want to continue using the calculator? (yes/no): yes

Error Handling

  • If invalid numbers are entered, the program will prompt you to enter valid numbers.
  • Division by zero will trigger an error message, preventing the operation from executing.

Contributing

Feel free to fork the repository and make improvements or report any issues you find!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages