DataMuseum.dk

Presents historical artifacts from the history of:

MIKADOS

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about MIKADOS

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦f836e03b6⟧

    Length: 992 (0x3e0)
    Notes: Mikados TextFile, Mikados_K
    Names: »MAX_MIN«

Derivation

└─⟦4cd80c18f⟧ Bits:30003895/4xCOMAL3a.imd 4 * COMAL - SPC/1 - Disketter til bogen
    └─⟦this⟧ »MAX_MIN« 
└─⟦bcf7b34c7⟧ Bits:30003895/4xCOMAL2.imd 4 * COMAL - SPC/1 - Disketter til bogen
    └─⟦this⟧ »MAX_MIN« 

Text

0010 // --------------------------- max-min -------------------------
0020 // 
0030 PROC F(X1)
0040 F:=X1*X1-1*X1+2
0050 ENDPROC F
0060 // 
0065 INTEGER ANTAL
0070 CLEAR 
0080 INPUT "Indtast venstre og højre intervalendepunkt:   ":VENSTRE,HØJRE
0090 INPUT "Indtast antal delintervaller:                  ":ANTAL
0100 PRINT 
0110 PRINT "Intervalendepunkterne er: ";VENSTRE;" og ";HØJRE
0120 PRINT "Der benyttes ";ANTAL+1;" støttepunkter"
0130 PRINT 
0140 IF HØJRE<VENSTRE THEN 
0150 BYT:=HØJRE;HØJRE:=VENSTRE;VENSTRE:=BYT
0160 ENDIF 
0170 SKRIDT:=(HØJRE-VENSTRE)/ANTAL
0180 MAX:=F(VENSTRE);MIN:=MAX
0190 FOR X:=VENSTRE TO HØJRE+0.000001 STEP SKRIDT DO 
0200 FX:=F(X)
0210 IF FX>MAX THEN MAX:=FX
0220 IF FX<MIN THEN MIN:=FX
0230 NEXT X
0240 PRINT 
0250 PRINT "Maximum er fundet til:   ";MAX
0260 PRINT "Minimum er fundet til:   ";MIN