|
|
DataMuseum.dkPresents historical artifacts from the history of: MIKADOS |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about MIKADOS Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 992 (0x3e0)
Types: TextFile
Notes: Mikados_K
Names: »MAX_MIN.K«
└─⟦4cd80c18f⟧ Bits:30003895/4xCOMAL3a.imd 4 * COMAL - SPC/1 - Disketter til bogen
└─⟦this⟧ »MAX_MIN.K«
└─⟦bcf7b34c7⟧ Bits:30003895/4xCOMAL2.imd 4 * COMAL - SPC/1 - Disketter til bogen
└─⟦this⟧ »MAX_MIN.K«
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
0x000…047 Line {l1=0x45, l2=»0010 // --------------------------- max-min -------------------------«, l3=0x45}
0x047…051 Line {l1=0x08, l2=»0020 // «, l3=0x08}
0x051…062 Line {l1=0x0f, l2=»0030 PROC F(X1)«, l3=0x0f}
0x062…078 Line {l1=0x14, l2=»0040 F:=X1*X1-1*X1+2«, l3=0x14}
0x078…088 Line {l1=0x0e, l2=»0050 ENDPROC F«, l3=0x0e}
0x088…092 Line {l1=0x08, l2=»0060 // «, l3=0x08}
0x092…0a6 Line {l1=0x12, l2=»0065 INTEGER ANTAL«, l3=0x12}
0x0a6…0b3 Line {l1=0x0b, l2=»0070 CLEAR «, l3=0x0b}
0x0b3…0fe Line {l1=0x49, l2=»0080 INPUT "Indtast venstre og højre intervalendepunkt: ":VENSTRE,HØJRE«, l3=0x49}
0x0fe…142 Line {l1=0x42, l2=»0090 INPUT "Indtast antal delintervaller: ":ANTAL«, l3=0x42}
0x142…14f Line {l1=0x0b, l2=»0100 PRINT «, l3=0x0b}
0x14f…18d Line {l1=0x3c, l2=»0110 PRINT "Intervalendepunkterne er: ";VENSTRE;" og ";HØJRE«, l3=0x3c}
0x18d…1c2 Line {l1=0x33, l2=»0120 PRINT "Der benyttes ";ANTAL+1;" støttepunkter"«, l3=0x33}
0x1c2…1cf Line {l1=0x0b, l2=»0130 PRINT «, l3=0x0b}
0x1cf…1ec Line {l1=0x1b, l2=»0140 IF HØJRE<VENSTRE THEN «, l3=0x1b}
0x1ec…219 Line {l1=0x2b, l2=»0150 BYT:=HØJRE;HØJRE:=VENSTRE;VENSTRE:=BYT«, l3=0x2b}
0x219…226 Line {l1=0x0b, l2=»0160 ENDIF «, l3=0x0b}
0x226…24a Line {l1=0x22, l2=»0170 SKRIDT:=(HØJRE-VENSTRE)/ANTAL«, l3=0x22}
0x24a…269 Line {l1=0x1d, l2=»0180 MAX:=F(VENSTRE);MIN:=MAX«, l3=0x1d}
0x269…2a0 Line {l1=0x35, l2=»0190 FOR X:=VENSTRE TO HØJRE+0.000001 STEP SKRIDT DO «, l3=0x35}
0x2a0…2af Line {l1=0x0d, l2=»0200 FX:=F(X)«, l3=0x0d}
0x2af…2cc Line {l1=0x1b, l2=»0210 IF FX>MAX THEN MAX:=FX«, l3=0x1b}
0x2cc…2e9 Line {l1=0x1b, l2=»0220 IF FX<MIN THEN MIN:=FX«, l3=0x1b}
0x2e9…2f6 Line {l1=0x0b, l2=»0230 NEXT X«, l3=0x0b}
0x2f6…303 Line {l1=0x0b, l2=»0240 PRINT «, l3=0x0b}
0x303…32f Line {l1=0x2a, l2=»0250 PRINT "Maximum er fundet til: ";MAX«, l3=0x2a}
0x32f…35b Line {l1=0x2a, l2=»0260 PRINT "Minimum er fundet til: ";MIN«, l3=0x2a}
0x35b…360 00 00 63 63 63 ┆ ccc┆
0x360…380 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 ┆cccccccccccccccccccccccccccccccc┆
[…0x3…]