Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Spencer Youngblood HW01SY

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.

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.