this post was submitted on 12 Mar 2024
1 points (100.0% liked)

/r/Denmark

153 readers
1 users here now

GÅ TIL FEDDIT.DK

Kommentarerne du skriver her sendes ikke tilbage til Reddit.

founded 1 year ago
MODERATORS
 
Dette indlæg blev automatisk arkiveret af Leddit-botten. Vil du diskutere tråden? Tilmeld dig på feddit.dk!

The original was posted on /r/denmark by /u/DF9-finishedwhen at 2024-03-12 06:42:10+00:00.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 7 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.