CALC1000 is a simple interactive COBOL program designed to illustrate fundamental COBOL concepts. The program prompts the user to enter a sales amount and calculates the corresponding sales tax using a fixed tax rate.
This project is intended for learning and demonstration purposes, particularly for those studying Mainframe COBOL.
- Program ID: CALC1000
- Programmer: Andre Philot
- Completion Date: July 11, 2025
- Language: COBOL
- Repeatedly prompts the user to enter a sales amount
- Calculates sales tax at a rate of 7.85%
- Displays the calculated tax, properly formatted
- Allows the user to exit the program by entering 0
- The program starts an interactive session.
- The user is prompted to enter a sales amount.
- If the user enters 0, the program ends.
- Otherwise, the program:
- Calculates the sales tax using the formula: SALES-TAX = SALES-AMOUNT × 0.0785
- Displays the formatted sales tax.
- The program repeats until the user exits.
- COBOL program structure (IDENTIFICATION, DATA, PROCEDURE divisions)
- WORKING-STORAGE variables
- PERFORM ... UNTIL loop
- User input with ACCEPT
- Output with DISPLAY
- Arithmetic processing using COMPUTE
- Numeric formatting with edited fields
- Use of level-77 data items
PRESS 0 AND ENTER TO EXIT THE PROGRAM. OTHERWISE, ENTER THE SALES AMOUNT. 123.45 THE SALES TAX IS 9.69.
This program can be compiled using:
- IBM Enterprise COBOL for z/OS
- GnuCOBOL (with minor environment adjustments)
Example using GnuCOBOL: cobc -x CALC1000.cbl ./CALC1000
- This program does not use file I/O.
- Input validation is minimal and assumes valid numeric input.
- Intended as a foundational example rather than a production-ready application.
This project is provided for educational purposes. Feel free to study, modify, and expand it as part of your COBOL learning journey.