Coders Packet

Basic calculator using C++

By Raghav Ambashta

  • Calculator/
  • This packet is a basic calculator using c++. This calculator performs operations such as addition, subtraction, division, and multiplication.

    Working of Basic Calculator application.

    Prerequisites: The system must have a C++ compiler.

     

    Steps to launch the calculator:

    Step 1: Double click on the calculator.exe file to launch the calculator in the terminal.

    Step 2: Enter the expression to be calculated.

    Step 3: A message will be prompted before giving the final results whether the user wants to update their expression.

    Step 4: Final results will be displayed.


    Key points:


    1. If the contains division by zero then a message will be prompted to re-type the expression.


    2. The expression may have any number of spaces between operand and operator.


    3. The character (Y or N) to be typed on the message whether the user wants to update their expression or not can be typed in any case (lowercase or uppercase).

    4. This calculator handles all edge cases such as preventing division by zero.

     


    In order to view the code open the calculator.cpp file in any IDE.

    Download Complete Code

    Comments

    Comments for the packet "Basic calculator using C++";
    No comments yet