Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  Valk p325.cob   Sprache: Cobol

 

       identification division.
       program-id. bankers-problem.
      * aus Valk-Girault Petri-Nets p325
       author. "JD".
       date-written. 16.5.2008.
       date-compiled.
       data division.
       working-storage section.
        77 bank       pic 9.
        77 credit1    pic 9.
        77 credit2    pic 9.
        77 claim1     pic 9.
        77 claim2     pic 9.
        77 blocked  pic 9.
       procedure division.
         display "gestartet"
         move 0 to credit1 credit2 claim2 blocked 
         move 5 to bank move 4 to claim1 move 3 to claim2
         perform until blocked=1
           move 1 to blocked
           if bank>0 and claim1>0 then 
             subtract 1 from bank claim1
             add 1 to credit1
             move 0 to blocked  
           else if bank>0 and claim2>0 then 
             subtract 1 from bank claim2 
             add 1 to credit2
             move 0 to blocked  
           else if credit1>0 then 
             subtract 1 from credit1 
             add 1 to bank claim1
             move 0 to blocked  
           else if credit2>0 then 
             subtract 1 from credit2 
             add 1 to bank claim2
             move 0 to blocked  
           end-if 
         end-perform.
         display "beendet"
        end-program subs.

Messung
CHZG
1009910099

¤ Dauer der Verarbeitung: 0.11 Sekunden  ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,188,836
#Domains=906,751