• Dannebot@leddit.danmark.partyOPMB
    link
    fedilink
    dansk
    arrow-up
    1
    ·
    9 months ago

    lnxtgr at 2024-03-12 14:46:23+00:00 ID: kukm0xz


    For at hjælpe fædrelandet og Skat har jeg skrevet en cobol procedure der burde kunne hjælpe dem med at fordele skatten over flere ejendomme/grunde:

    IDENTIFICATION DIVISION.
       PROGRAM-ID. TaxRedistribution.
    
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT TaxDetails ASSIGN TO 'TAXFILE'
               ORGANIZATION IS LINE SEQUENTIAL.
    
       DATA DIVISION.
       FILE SECTION.
       FD  TaxDetails.
       01  TaxRecord.
           05 TotalTax         PIC 9(8)V99 VALUE ZEROS.
           05 NumberOfPlots    PIC 9(3) VALUE ZEROS.
    
       WORKING-STORAGE SECTION.
       01  TaxPerPlot         PIC 9(8)V99 VALUE ZEROS.
       01  Counter            PIC 9(3) VALUE ZEROS.
    
       PROCEDURE DIVISION.
       BEGIN.
           OPEN INPUT TaxDetails
           READ TaxDetails INTO TaxRecord
               AT END
                   DISPLAY "No data found."
                   GO TO END-OF-JOB
               NOT AT END
                   PERFORM CALCULATE-TAX-PER-PLOT
           END-READ
           CLOSE TaxDetails
           STOP RUN.
    
       CALCULATE-TAX-PER-PLOT.
           DIVIDE TotalTax OF TaxRecord BY NumberOfPlots OF TaxRecord GIVING TaxPerPlot
           PERFORM VARYING Counter FROM 1 BY 1 UNTIL Counter > NumberOfPlots OF TaxRecord
               DISPLAY "Tax for plot ", Counter, ": ", TaxPerPlot
           END-PERFORM.
    
       END-OF-JOB.
           EXIT.