Expert Answers

How do you create an object of a class, in COBOL?

Write the code to test if ITEM contains both letters and numbers.

Given the following code:
05 IMPATIENS-COLOR PIC 9.
88 RED VALUE 1.
88 PINK VALUE 2.
88 ORANGE VALUE 3.

Write the EVALUATE statement to validate this input.

Write the code to count the number of occurrences of the digit 6 until the first space is encountered in ITEM. Use A-COUNT as the storage parameter.

Write the PROCEDURE DIVISION code segment to sum all the numbers from 1 through 100. Use an in-line PERFORM UNTIL

Write the PROCEDURE DIVISION code segment to sum all the numbers from 1 through 100. Use a PERFORM paragraph-name ..TIMES

Given the following code:
MOVE 10 TO NUM
MOVE 1 TO TOTAL
PERFORM 200-TOTAL-RTN 5 TIMES

200-TOTAL-RTN.
MULTIPLY TOTAL BY NUM
DISPLAY TOTAL..

a) Recode this using an in-line PERFORM N TIMES

b) What is output?