Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
|
|
@ -0,0 +1,13 @@
|
|||
100 REM Temperature conversion
|
||||
110 DO
|
||||
120 INPUT PROMPT "Kelvin degrees ":K
|
||||
130 IF K < 0 THEN EXIT DO
|
||||
140 LET C = K - 273.15
|
||||
150 LET F = K * 1.8 - 459.67
|
||||
160 LET R = K * 1.8
|
||||
170 PRINT K; "Kelvin is equivalent to"
|
||||
180 PRINT C; "degrees Celsius,"
|
||||
190 PRINT F; "degrees Fahrenheit,"
|
||||
200 PRINT R; "degrees Rankine."
|
||||
210 LOOP
|
||||
220 END
|
||||
20
Task/Temperature-conversion/ASIC/temperature-conversion.asic
Normal file
20
Task/Temperature-conversion/ASIC/temperature-conversion.asic
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
REM Temperature conversion
|
||||
PRINT "Kelvin degrees";
|
||||
INPUT K@
|
||||
WHILE K@ >= 0
|
||||
C@ = K@ - 273.15
|
||||
R@ = K@ * 1.8
|
||||
F@ = R@ - 459.67
|
||||
CLS
|
||||
PRINT K@;
|
||||
PRINT " Kelvin is equivalent to"
|
||||
PRINT C@;
|
||||
PRINT " degrees Celsius,"
|
||||
PRINT F@;
|
||||
PRINT " degrees Fahrenheit,"
|
||||
PRINT R@;
|
||||
PRINT " degrees Rankine."
|
||||
PRINT "Kelvin degrees";
|
||||
INPUT K@
|
||||
WEND
|
||||
END
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
10 REM TRANSLATION OF AWK VERSION
|
||||
20 INPUT "KELVIN DEGREES",K
|
||||
30 IF K <= 0 THEN END: REM A VALUE OF ZERO OR LESS WILL END PROGRAM
|
||||
40 LET C = K - 273.15
|
||||
50 LET F = K * 1.8 - 459.67
|
||||
60 LET R = K * 1.8
|
||||
70 PRINT K; " KELVIN IS EQUIVALENT TO"
|
||||
80 PRINT C; " DEGREES CELSIUS"
|
||||
90 PRINT F; " DEGREES FAHRENHEIT"
|
||||
100 PRINT R; " DEGREES RANKINE"
|
||||
110 GOTO 20
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
10 CLS : REM 10 HOME for Applesoft BASIC : DELETE for Minimal BASIC
|
||||
20 PRINT "Kelvin Degrees ";
|
||||
30 INPUT K
|
||||
40 IF K <= 0 THEN 130
|
||||
40 IF K < 0 THEN 130
|
||||
50 LET C = K-273.15
|
||||
60 LET F = K*1.8-459.67
|
||||
70 LET R = K*1.8
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
module ZX81_code {
|
||||
10 PRINT "ENTER A TEMPERATURE IN KELVINS"
|
||||
20 INPUT K
|
||||
30 PRINT K;" KELVINS ="
|
||||
40 PRINT K-273.15;" DEGREES CELSIUS"
|
||||
50 PRINT K*1.8-459.67;" DEGREES FAHRENHEIT"
|
||||
60 PRINT K*1.8;" DEGREES RANKINE"
|
||||
}
|
||||
ZX81_code
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
Module Temprature_Conversions {
|
||||
Module Decorated_Modules {
|
||||
Module Cnvt2Fahrenheit (x){Push "Fahrenheit", Round(x*1.8+32, 2)}
|
||||
Module CnvtFromFahrenheit (x) {Push "Fahrenheit", Round((x-32)/1.8, 2)}
|
||||
Module Cnvt2Kelvin (x){Push "Kelvin", Round(x+273.15, 2)}
|
||||
Module CnvtFromKelvin (x){Push "Kelvin", Round(x-273.15, 2)}
|
||||
Module Cnvt2Rankine (x){Push "Rankine", Round(x*1.8+ 491.67, 2) }
|
||||
Module CnvtFromRankine (x){Push "Rankine", Round((x-491.67)/1.8, 2)}
|
||||
Module Temperatures {
|
||||
Convertion
|
||||
data format$("From {0}° {1} convert to {2}° {3}", number, letter$, number, letter$)
|
||||
}
|
||||
k=253.15
|
||||
Data "Kelvin="+k
|
||||
Temperatures k ; cnvtForm as CnvtFromKelvin
|
||||
Temperatures k ; cnvtForm as CnvtFromKelvin, convert as Cnvt2Fahrenheit
|
||||
Temperatures k ; cnvtForm as CnvtFromKelvin, convert as Cnvt2Rankine
|
||||
k=-20
|
||||
Data "Celsius="+k
|
||||
Temperatures k ; convert as Cnvt2Kelvin
|
||||
Temperatures k ; convert as Cnvt2Fahrenheit
|
||||
Temperatures k ; convert as Cnvt2Rankine
|
||||
k=-4
|
||||
Data "Fahrenheit="+k
|
||||
Temperatures k ; cnvtForm as CnvtFromFahrenheit, convert as Cnvt2Kelvin
|
||||
Temperatures k ;cnvtForm as CnvtFromFahrenheit
|
||||
Temperatures k ;cnvtForm as CnvtFromFahrenheit, convert as Cnvt2Rankine
|
||||
k=455.67
|
||||
Data "Rankine="+k
|
||||
Temperatures k ; cnvtForm as CnvtFromRankine, convert as Cnvt2Kelvin
|
||||
Temperatures k ;cnvtForm as CnvtFromRankine
|
||||
Temperatures k ;cnvtForm as CnvtFromRankine, convert as Cnvt2Fahrenheit
|
||||
|
||||
}
|
||||
Module Global Convertion {
|
||||
over ' doublicate stack
|
||||
Module cnvtForm {
|
||||
Push "Celsius" : shift 2
|
||||
}
|
||||
Module convert {
|
||||
Push "Celsius" : shift 2
|
||||
}
|
||||
cnvtForm : convert
|
||||
Shift 3 ' move 3rd to 1st
|
||||
Shift 4 ' move 4th to 1st
|
||||
}
|
||||
Module TemperaturesGreek {
|
||||
Convertion
|
||||
data format$("Από {0}° {1} μετατροπή σε {2}° {3}", number, letter$, number, letter$)
|
||||
}
|
||||
Flush
|
||||
Data "==========English=========="
|
||||
Decorated_Modules
|
||||
Data "==========Ελληνικά=========="
|
||||
Decorated_Modules ; Temperatures as TemperaturesGreek
|
||||
Report$ = array([])#str$(chr$(13)+chr$(10))
|
||||
ClipBoard Report$
|
||||
Report Report$
|
||||
}
|
||||
Temprature_Conversions
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
MODULE TempConv;
|
||||
(* Temperature conversion *)
|
||||
FROM STextIO IMPORT
|
||||
SkipLine, WriteString, WriteLn;
|
||||
FROM SRealIO IMPORT
|
||||
ReadReal, WriteFixed;
|
||||
|
||||
VAR
|
||||
K, C, F, R: REAL;
|
||||
BEGIN
|
||||
WriteString("Temperature to convert (in Kelvin): ");
|
||||
ReadReal(K);
|
||||
SkipLine;
|
||||
WriteString("K: "); WriteFixed(K, 3, 8); WriteLn;
|
||||
C := K - 273.15;
|
||||
WriteString("C: "); WriteFixed(C, 3, 8); WriteLn;
|
||||
F := 1.8 * C + 32.0;
|
||||
WriteString("F: "); WriteFixed(F, 3, 8); WriteLn;
|
||||
R := F + 459.67;
|
||||
WriteString("R: "); WriteFixed(R, 3, 8); WriteLn;
|
||||
END TempConv.
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
' Temperature conversion
|
||||
DO
|
||||
INPUT "Kelvin degrees (>=0): ", K
|
||||
INPUT "Kelvin degrees (>=0): ", K
|
||||
LOOP UNTIL K >= 0
|
||||
|
||||
PRINT "K = " + STR$(K)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
10 PRINT "Kelvin Degrees ";
|
||||
20 INPUT ""; K
|
||||
30 IF K <= 0 THEN END
|
||||
30 IF K < 0 THEN END
|
||||
40 LET C = K-273.15
|
||||
50 LET F = K*1.8-459.67
|
||||
60 LET R = K*1.8
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
'Temperature conversion
|
||||
DO
|
||||
INPUT "Kelvin degrees "; K
|
||||
IF K < 0 THEN EXIT DO
|
||||
C = K - 273.15
|
||||
F = K * 1.8 - 459.67
|
||||
R = K * 1.8
|
||||
PRINT K; " Kelvin is equivalent to"
|
||||
PRINT C; " degrees Celsius,"
|
||||
PRINT F; " degrees Fahrenheit,"
|
||||
PRINT R; " degrees Rankine."
|
||||
LOOP
|
||||
END
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
10 REM Translation of traditional basic version
|
||||
20 INPUT "Kelvin Degrees? ";k
|
||||
30 IF k <= 0 THEN STOP: REM A value of zero or less will end program
|
||||
30 IF k < 0 THEN STOP: REM A value less than zero will end program
|
||||
40 LET c = k - 273.15
|
||||
50 LET f = k * 1.8 - 459.67
|
||||
60 LET r = k * 1.8
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue