runnerup747

COBOL Prog1 updated

Feb 25th, 2020
739
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.        program-id. Program1 as "rennerc_Program1.Program1".
  2.        data division.
  3.        working-storage section.
  4.        01 WS-INPUT.
  5.            05  WS-NAME        PIC A(25).
  6.            05  WS-ADDR        PIC X(25).
  7.            05  WS-ZIP         PIC X(25).
  8.            05  WS-PHONE       PIC 9999999999.
  9.            05  WS-BIKE-DESC   PIC X(32).
  10.            05  WS-BIKE-PRICE  PIC 9999V99 VALUE 0.
  11.            05  WS-ACC1        PIC A(25).
  12.            05  WS-ACC1-PRICE       PIC 999V99 VALUE 0.
  13.            05  WS-ACC2        PIC A(25).
  14.            05  WS-ACC2-PRICE       PIC 999V99 VALUE 0.
  15.            05  WS-ACC3        PIC A(25).
  16.            05  WS-ACC3-PRICE       PIC 999V99 VALUE 0.
  17.            05  WS-ACC4        PIC A(25).
  18.            05  WS-ACC4-PRICE       PIC 999V99 VALUE 0.
  19.            05  WS-EXIT        PIC X VALUE SPACES.
  20.        01  WD-DISPLAY.
  21.            05  WD-NAME         PIC A(25).
  22.            05  WD-ADDR         PIC X(25).
  23.            05  WD-ZIP          PIC X(25).
  24.            05  WD-PHONE        PIC 9(9).
  25.            05 Subtotal         PIC 9999V99 VALUE 0.
  26.            05 Total-Price      PIC 9999V99 VALUE 0.
  27.            05  Net-Price       PIC 9999V99 VALUE 0.
  28.            05 B-Discnt-Price   PIC 9999V99 VALUE 0.
  29.        01  WC-CONSTANTS.
  30.            05 2-Discount       PIC P99 VALUE .02.
  31.            05 3-Discount       PIC P99 VALUE .03.
  32.            05 5-Discount       PIC P99 VALUE .05.
  33.            05 10-Discount      PIC 9V99 VALUE 0.10.
  34.            05 Sales-Tax        PIC 9V999 VALUE 1.055.
  35.        SCREEN SECTION.
  36.        01  Screen-1.
  37.            05  BLANK SCREEN
  38.                FOREGROUND-COLOR 7
  39.                BACKGROUND-COLOR 0
  40.                HIGHLIGHT.
  41.        01  Invoice-Screen.
  42.            05  VALUE "Collin Renner" BLANK SCREEN      LINE 1 COL 1.
  43.            05  VALUE "Bicycle Invoice"                 LINE 1 COL 26.
  44.            05  VALUE "Customer Name           :"       LINE 3 COL 1.
  45.            05  NAME-INPUT    PIC A(25) TO WS-NAME      LINE 3 COL 26.
  46.            05  VALUE "Customer Address        :"       LINE 4 COL 1.
  47.            05  ADDR-INPUT    PIC X(25) TO WS-ADDR      LINE 4 COL 26.
  48.            05  VALUE "Customer City, State Zip:"       LINE 5 COL 1.
  49.            05  CITY-INPUT    PIC X(25) TO WS-ZIP       LINE 5 COL 26.
  50.            05  VALUE "Customer Phone #        :"       LINE 6 COL 1.
  51.            05  PHONE-INPUT   PIC 9(10) TO WS-PHONE     LINE 6 COL 26.
  52.            05  VALUE "ITEMS ORDERED"                   LINE 8 COL 1.
  53.            05  VALUE "Price"                           LINE 8 COL 45.
  54.            05  VALUE "Bicycle:  "                      LINE 9 COL 1.
  55.            05  BIKE-INPUT    PIC X(32) TO WS-BIKE-DESC LINE 9 COL 11.
  56.            05  PRICE-INPUT   PIC 9(4)V99 TO WS-BIKE-PRICE LINE 9 COL 44.
  57.            05  VALUE "XXXXX to end accessories"        LINE 10 COL 1.
  58.            05  VALUE "Accessory 1: "                   LINE 11 COL 1.
  59.       *CAN I DO THE NESTED IF STATEMENTS IN HERE? IM NOT SURE HOW ELSE TO CHECK FOR 'XXXXX'
  60.            05  ACC1-INPUT    PIC A(25) TO WS-ACC1     LINE 11 COL 14.
  61.            05  ACC1-PRICE-INPUT     PIC 999V99 TO WS-ACC1-PRICE     LINE 11 COL 44.
  62.            05  VALUE "Accessory 2: "                   LINE 12 COL 1.
  63.            05  ACC2-INPUT    PIC A(25) TO WS-ACC2     LINE 12 COL 14.
  64.            05  ACC2-PRICE-INPUT     PIC 999V99 TO WS-ACC2-PRICE     LINE 12 COL 44.
  65.            05  VALUE "Accessory 3: "                   LINE 13 COL 1.
  66.            05  ACC3-INPUT    PIC A(25) TO WS-ACC3     LINE 13 COL 14.
  67.            05  ACC3-PRICE-INPUT     PIC 999V99 TO WS-ACC3-PRICE     LINE 13 COL 44.
  68.            05  VALUE "Accessory 4: "                   LINE 14 COL 1.
  69.            05  ACC4-INPUT    PIC A(25) TO WS-ACC4     LINE 14 COL 14.
  70.            05  ACC4-PRICE-INPUT     PIC 999V99 TO WS-ACC4-PRICE     LINE 14 COL 44.
  71.            05  VALUE "----------"                      LINE 15 COL 42.
  72.       *I almost wonder if this should be a second screen, doing calculations and display after accepting values.
  73.            05  VALUE "Subtotal"                        LINE 16 COL 1.
  74.       *need to input calculated subtotal now
  75.            05  VALUE "Discount"                        LINE 17 COL 1.
  76.            05  VALUE "----------"                      LINE 18 COL 42.
  77.            05  VALUE "Net Sale"                        LINE 19 COL 1.
  78.            05  VALUE "Sales Tax"                       LINE 20 COL 1.
  79.            05  VALUE "----------"                      LINE 21 COL 42.
  80.            05  VALUE "Invoice Total"                   LINE 22 COL 1.
  81.            05  VALUE "ENTER 'X' AND PRESS THE ENTER KEY TO EXIT THE PROGRAM... "              LINE 23 COL 1.
  82.            05  INPUT-EXIT PIC X TO WS-EXIT.
  83.  
  84.  
  85.        procedure division.
  86.        MAIN.
  87.            perform B-100
  88.                UNTIL WS-EXIT = "X".
  89.            stop run.
  90.        B-100.
  91.            DISPLAY Invoice-Screen.
  92.            ACCEPT Invoice-Screen.
  93.  
  94.  
  95.            
  96.  
  97.            goback.
  98.            
  99.        end program Program1.
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×