You are writing a COBOL program to calculate the total cost of items in a shopping cart. Which type of COBOL variable would you use to store the individual item prices?
- PIC 9(3) DISPLAY
- PIC 9(5)V99 COMP-3
- PIC S9(4) USAGE COMP
- PIC X(10)
For storing monetary values like individual item prices in a COBOL program, PIC 9(5)V99 COMP-3 is suitable. This usage efficiently represents decimal numbers and ensures accurate calculations.
Loading...
Related Quiz
- In COBOL, the "ELSE" clause is executed when the condition in the "IF" statement is _____
- What strategies can be employed to handle large datasets with potential duplicate records efficiently in COBOL programs?
- Why might you choose variable-length records over fixed-length records in COBOL file processing?
- How can file organization impact performance optimization in COBOL programs?
- When working with indexed files in COBOL, what is the key used for accessing records?