--%>

Problem on COBOL if sentence

Write a COBOL IF sentence to use the values of numeric variables EXAM and COURSEWORK, both assumed to be with format PIC 999 and in the range 0 to 100 and to move the value:
“FAIL”,
“RC” ( resit coursework),
“RE” (resit examination”),
“RB” (resit both examination and coursework) or
“PASS”
 to the variable RESULT with format PIC XXXX, according to this flowchart:

1201_cobol.jpg

E

Expert

Verified

Using EVALUATE is easier, but since asked to use IF
Assume Passing mark is 50

01 EXAM PIC 999
01 COURSEWORK PIC 999
01 RESULT PIC X(4)
 
ACCEPT EXAM.
ACCEPT COURSEWORK.

IF EXAM<30 AND COURSEWORK<30
    MOVE ‘FAIL’ TO RESULT
IF EXAM>39 AND (COURSEWORK>29 AND COURSEWORK<40)
    MOVE ‘RC’ TO RESULT
IF (EXAM>29 AND EXAM<40) AND COURSEWORK>49
    MOVE ‘RE’ TO RESULT
IF (EXAM>29 AND EXAM<40) AND(COURSEWORK>29 AND COURSEWORK<40)
    MOVE ‘RB’TO RESULT
IF EXAM>39AND COURSEWORK>39
    MOVE ‘PASS’ TO RESULT
DISPLAY RESULT.

   Related Questions in Programming Languages

  • Q : Explain why java is so important for

    The internet aided java to the forefront of programming. And java consequently has had a deep effect on the internet. The reason for this is highly simple: java uses the universe of objects that can travel freely in cyber space. In a network, two broad categories of

  • Q : Explain functionality or an API needs

    The application I am creating needs having access to functionality or an API that use needs the Nokia Vendor ID. For my application how can I have this Nokia VID?

  • Q : What is a Port Port: It is a number

    Port: It is a number employed by a procedure to communicate with the other procedure across a network, employing the Transmission Control Protocol (abbreviated as TCP) or User Datagram Protocol (abbreviated as UDP), for instance.

  • Q : Explain the distributed systems Explain

    Explain the distributed systems.

  • Q : Examples for 8 -16 - 32 bit

    Normal 0 false false

  • Q : Compute Days Between Ordering and

    An analyst in the quality assurance office reviews the time lapse between receiving an order and shipping an order. Any orders which have not been shipped in a day of the order being positioned are investigated. Build a function named ORD_SHIP_SF which computes the nu

  • Q : Define the term Swizzling Define the

    Define the term Swizzling: It is the process of recursively writing the contents of an object through object serialization.

  • Q : Define Number base Number base : The

    Number base: The base employed to interpret the numerical characters. Binary notation is base 2 and decimal notation is base 10, for illustration.

  • Q : Meaning of active and passive objects

    Illustrate in brief the meaning of active and passive objects?

  • Q : What is Random Access Memory Random

    Random Access Memory: Random access memory, or RAM, is the memory whose contents are simply accessible to the processing components of a computer. In specific, the time it takes to read and write to a particular portion of the memory does not based on