This is a simple calculator written in Cobol. It can add, subtract, multiply and divide two numbers. additionaly depending on if the number is odd or even it will display a message.
A friend didn't believe me when I said I could write a calculator in Cobol. Guess who's gramps taught him Cobol in 2010 ?
We'll use docker to run the program even tho it's overkill for a simple calculator.
once the repo is cloned. Change directory to the root of the project and run the following command:
docker build -t cobol-calculator .
docker run -it cobol-calculatorThis will build the docker image and run the program.
To use the Cobol calculator, follow these steps:
- Run the program as described in the "How to run" section.
- When prompted, enter the first number.
- Enter the operator you want to use (
+,-,*, or/). - Enter the second number.
- The program will display the result and indicate whether it is odd or even.
Example usage:
Enter first number: 10
Enter operator (+, -, *, /): +
Enter second number: 5
Result: 15 (ODD)Thank you for visiting !