IDENTIFICATION DIVISION. PROGRAM-ID. HW01SY. AUTHOR. SPENCER YOUNGBLOOD. DATA DIVISION. WORKING-STORAGE SECTION. 01 WS-PROFESSOR-NAME PICTURE X(10) VALUE 'Youngblood'. 01 WS-COURSE-SCORE PICTURE 9(03) VALUE 68. 01 WS-PASSING-SCORE PICTURE 9(02) VALUE 70. 01 WS-POINTS-UNDER-PASSING PICTURE 9(02) VALUE 0. PROCEDURE DIVISION. DISPLAY 'Hello, Professor ' WS-PROFESSOR-NAME ' here!' ACCEPT WS-COURSE-SCORE. IF WS-COURSE-SCORE >= WS-PASSING-SCORE DISPLAY 'You passed the course with a score of: ' WS-COURSE-SCORE DISPLAY 'Good job!' ELSE DISPLAY 'Uh-oh, your score of ' WS-COURSE-SCORE ' did not pass.' DISPLAY 'A score below ' WS-PASSING-SCORE ' is a failing grade.' COMPUTE WS-POINTS-UNDER-PASSING = WS-PASSING-SCORE - WS-COURSE-SCORE DISPLAY 'You needed ' WS-POINTS-UNDER-PASSING ' more points to pass.' DISPLAY 'Please insert 3 more credits and try again...' STOP RUN.
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more