       midentification division.
       program-id. opgave-IF.
       author. Keppens Toon.

       environment division.
       configuration section.
       source-computer. PC.
       object-computer. PC.

       data division.
       working-storage section.
       01 scherm-1.
           03 lijn-dubbel pic x(35)
               value ":::::::::::::::::::::::::::::::::::".
           03 lijn-info-top pic x(60)
               value "Hogeschool Gent  --   Departement BEST".
           03 lijn-info-bottom pic x(12) value "Keppens Toon".
           03 lijn-info-midden-1 pic x(63)
               value "------------------------- Basisbewerkingen -------
      -        "------------".
           03 lijn-info-midden-2 pic x(63)
               value "--------------------------------------------------
      -        "------------".
           03 lijn-dubbelpunt pic x(1) value ":".

       01 datum pic 99/99/99.

       77 verdergaan pic x.
           88 stoppen value "N" "n".
           88 verder-juist value "J" "j" "N" "n".

       01 input-data.
           03 getal1 pic s999 sign leading separate.
           03 getal2 pic s999 sign leading separate.
           03 keuze pic 9.
           03 resultaat-compute pic s9999 sign leading separate.
           03 resultaat-z-compute pic s9999 sign leading separate.
           03 rest pic s999 sign leading separate.

       procedure division.
       main.
       perform hoofdprogramma with test after
           until stoppen
       stop run.

       hoofdprogramma.

      *    ############# OPBOUWEN VAN HET SCHERM ##############
           accept datum from date
           display spaces upon crt
           display lijn-dubbel at 0206 with foreground-color is 2
           display lijn-dubbel at 0241 with foreground-color is 2
           display lijn-info-top at 0308 with foreground-color is 3
           display datum at 0366 with foreground-color is 3
           display lijn-dubbelpunt at 0306 with foreground-color is 2
           display lijn-dubbelpunt at 0375 with foreground-color is 2
           display lijn-dubbel at 0406 with foreground-color is 2
           display lijn-dubbel at 0441 with foreground-color is 2
           display lijn-dubbelpunt at 0506 with foreground-color is 2
           display lijn-dubbelpunt at 0575 with foreground-color is 2
           display lijn-dubbelpunt at 0606 with foreground-color is 2
           display lijn-dubbelpunt at 0675 with foreground-color is 2
           display lijn-info-midden-1 at 0610
           display lijn-dubbelpunt at 0706 with foreground-color is 2
           display lijn-dubbelpunt at 0775 with foreground-color is 2
           display lijn-dubbelpunt at 0806 with foreground-color is 2
           display lijn-dubbelpunt at 0875 with foreground-color is 2
           display lijn-dubbelpunt at 0906 with foreground-color is 2
           display lijn-dubbelpunt at 0975 with foreground-color is 2
           display lijn-dubbelpunt at 1006 with foreground-color is 2
           display lijn-dubbelpunt at 1075 with foreground-color is 2
           display lijn-dubbelpunt at 1106 with foreground-color is 2
           display lijn-dubbelpunt at 1175 with foreground-color is 2
           display lijn-info-midden-2 at 1410
           display lijn-dubbelpunt at 1206 with foreground-color is 2
           display lijn-dubbelpunt at 1275 with foreground-color is 2
           display lijn-dubbelpunt at 1306 with foreground-color is 2
           display lijn-dubbelpunt at 1375 with foreground-color is 2
           display lijn-dubbelpunt at 1406 with foreground-color is 2
           display lijn-dubbelpunt at 1475 with foreground-color is 2
           display lijn-dubbelpunt at 1506 with foreground-color is 2
           display lijn-dubbelpunt at 1575 with foreground-color is 2
           display lijn-dubbelpunt at 1606 with foreground-color is 2
           display lijn-dubbelpunt at 1675 with foreground-color is 2
           display lijn-dubbelpunt at 1706 with foreground-color is 2
           display lijn-dubbelpunt at 1775 with foreground-color is 2
           display lijn-dubbelpunt at 1806 with foreground-color is 2
           display lijn-dubbelpunt at 1875 with foreground-color is 2
           display lijn-dubbelpunt at 1906 with foreground-color is 2
           display lijn-dubbelpunt at 1975 with foreground-color is 2
           display lijn-dubbelpunt at 2006 with foreground-color is 2
           display lijn-dubbelpunt at 2075 with foreground-color is 2
           display lijn-dubbel at 2106 with foreground-color is 2
           display lijn-dubbel at 2141 with foreground-color is 2
           display lijn-info-bottom at 2234 with foreground-color is 3
           display lijn-dubbelpunt at 2206 with foreground-color is 2
           display lijn-dubbelpunt at 2275 with foreground-color is 2
           display lijn-dubbel at 2306 with foreground-color is 2
           display lijn-dubbel at 2341 with foreground-color is 2

           display "Getal 1: " at 0810 with foreground-color is 8
           display "Getal 2: " at 1010 with foreground-color is 8
           display "1. Optellen" at 0856 with foreground-color is 8
           display "2. Verschil" at 0956 with foreground-color is 8
           display "3. Product" at 1056 with foreground-color is 8
           display "4. Deling" at 1156 with foreground-color is 8
           display "5. Restdeling" at 1256 with foreground-color is 8
           display "Keuze: " at 0846 with foreground-color is 8
           display "Resultaat zonder compute: "
               at 1610 with foreground-color is 8
           display "Resultaat met compute: "
               at 1810 with foreground-color is 8

           initialize input-data

           accept getal1 at 0819 with foreground-color is 7
           accept getal2 at 1019 with foreground-color is 7
           accept keuze at 0853 with foreground-color is 7

      *    ###########  BEREKENINGEN MET COMPUTE ###########
           if keuze = 1 then
               compute resultaat-compute = getal1 + getal2
           end-if
           if keuze = 2 then
               compute resultaat-compute = getal1 - getal2
           end-if
           if keuze = 3 then
               compute resultaat-compute = getal1 * getal2
           end-if
           if keuze = 4 then
               compute resultaat-compute = getal1 / getal2
           end-if
           if keuze = 5 then
               compute resultaat-compute = getal1 / getal2
           end-if

      *    #########  BEREKENINGEN ZONDER COMPUTE ##########
           if keuze = 1 then
               add getal1 to getal2 giving resultaat-z-compute
           end-if
           if keuze = 2 then
           subtract getal2 from getal1 giving resultaat-z-compute
           end-if
           if keuze = 3 then
               multiply getal1 by getal2 giving resultaat-z-compute
           end-if
           if keuze = 4 then
               divide getal2 into getal1 giving resultaat-z-compute
           end-if
           if keuze = 5 then
               divide getal2 into getal1 giving resultaat-z-compute
               remainder rest
               display "Rest: " at 1648 with foreground-color is 8
               display rest at 1655 with foreground-color is 7
           end-if

      *    ############# RESULTATEN WEERGEVEN ##############
           display resultaat-z-compute
               at 1640 with foreground-color is 7
           display resultaat-compute
               at 1840 with foreground-color is 7

           display "Opnieuw?: " at 1848 with foreground-color is 8
           accept verdergaan at 1858 with foreground-color is 7

           perform v-i-verder
               until verder-juist
           .

       v-i-verder.
           accept verdergaan at 1858 with foreground-color is 7
           .
