Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,14 +0,0 @@
|
|||
with Ada.Float_Text_IO, Ada.Text_IO; use Ada.Float_Text_IO, Ada.Text_IO;
|
||||
|
||||
procedure Temperatur_Conversion is
|
||||
K: Float;
|
||||
function C return Float is (K - 273.15);
|
||||
function F return Float is (K * 1.8 - 459.67);
|
||||
function R return Float is (K * 1.8);
|
||||
begin
|
||||
Get(K); New_Line; -- Format
|
||||
Put("K: "); Put(K, Fore => 4, Aft => 2, Exp => 0); New_Line;-- K: dddd.dd
|
||||
Put("C: "); Put(C, Fore => 4, Aft => 2, Exp => 0); New_Line;-- C: dddd.dd
|
||||
Put("F: "); Put(F, Fore => 4, Aft => 2, Exp => 0); New_Line;-- F: dddd.dd
|
||||
Put("R: "); Put(R, Fore => 4, Aft => 2, Exp => 0); New_Line;-- R: dddd.dd
|
||||
end;
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
; ### USAGE - TESTING PURPOSES ONLY
|
||||
|
||||
Local Const $_KELVIN = 21
|
||||
ConsoleWrite("Kelvin: " & $_KELVIN & @CRLF)
|
||||
ConsoleWrite("Kelvin: " & Kelvin(21, "C") & @CRLF)
|
||||
ConsoleWrite("Kelvin: " & Kelvin(21, "F") & @CRLF)
|
||||
ConsoleWrite("Kelvin: " & Kelvin(21, "R") & @CRLF)
|
||||
|
||||
; ### KELVIN TEMPERATURE CONVERSIONS
|
||||
|
||||
Func Kelvin($degrees, $conversion)
|
||||
Select
|
||||
Case $conversion = "C"
|
||||
Return Round($degrees - 273.15, 2)
|
||||
Case $conversion = "F"
|
||||
Return Round(($degrees * 1.8) - 459.67, 2)
|
||||
Case $conversion = "R"
|
||||
Return Round($degrees * 1.8, 2)
|
||||
EndSelect
|
||||
EndFunc ;==> Kelvin
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. temp-conversion.
|
||||
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
78 Kelvin-Rankine-Ratio VALUE 0.5556. *> 5 / 9 to 4 d.p.
|
||||
78 Kelvin-Celsius-Diff VALUE 273.15.
|
||||
78 Rankine-Fahrenheit-Diff VALUE 459.67.
|
||||
|
||||
01 temp-kelvin PIC S9(8)V99.
|
||||
01 temp-rankine PIC S9(8)V99.
|
||||
|
||||
01 kelvin PIC -(7)9.99.
|
||||
01 celsius PIC -(7)9.99.
|
||||
01 rankine PIC -(7)9.99.
|
||||
01 fahrenheit PIC -(7)9.99.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
DISPLAY "Enter a temperature in Kelvin to convert: " NO ADVANCING
|
||||
ACCEPT temp-kelvin
|
||||
|
||||
MOVE temp-kelvin TO kelvin
|
||||
DISPLAY "K " kelvin
|
||||
|
||||
SUBTRACT Kelvin-Celsius-Diff FROM temp-kelvin GIVING celsius
|
||||
DISPLAY "C " celsius
|
||||
|
||||
DIVIDE temp-kelvin BY Kelvin-Rankine-Ratio
|
||||
GIVING temp-rankine, rankine
|
||||
SUBTRACT Rankine-Fahrenheit-Diff FROM temp-rankine GIVING fahrenheit
|
||||
|
||||
DISPLAY "F " fahrenheit
|
||||
DISPLAY "R " rankine
|
||||
|
||||
GOBACK
|
||||
.
|
||||
|
|
@ -9,25 +9,25 @@ convertKelvinToRankine(x)
|
|||
convertKelvinToCelsius(x)
|
||||
= x - 273.15r;
|
||||
|
||||
public program()
|
||||
public Program()
|
||||
{
|
||||
console.print("Enter a Kelvin Temperature: ");
|
||||
Console.print("Enter a Kelvin Temperature: ");
|
||||
var inputVal := console.readLine();
|
||||
real kelvinTemp := 0.0r;
|
||||
try
|
||||
{
|
||||
kelvinTemp := realConvertor.convert(inputVal)
|
||||
kelvinTemp := RealConvertor.convert(inputVal)
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
console.printLine("Invalid input value: ", inputVal);
|
||||
Console.printLine("Invalid input value: ", inputVal);
|
||||
|
||||
AbortException.raise()
|
||||
};
|
||||
|
||||
console.printLine("Kelvin: ", kelvinTemp);
|
||||
console.printLine("Fahrenheit: ", convertKelvinToFahrenheit(kelvinTemp));
|
||||
console.printLine("Rankine: ", convertKelvinToRankine(kelvinTemp));
|
||||
console.printLine("Celsius: ", convertKelvinToCelsius(kelvinTemp));
|
||||
console.readChar()
|
||||
Console.printLine("Kelvin: ", kelvinTemp);
|
||||
Console.printLine("Fahrenheit: ", convertKelvinToFahrenheit(kelvinTemp));
|
||||
Console.printLine("Rankine: ", convertKelvinToRankine(kelvinTemp));
|
||||
Console.printLine("Celsius: ", convertKelvinToCelsius(kelvinTemp));
|
||||
Console.readChar()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
include std/console.e
|
||||
|
||||
atom K
|
||||
while 1 do
|
||||
K = prompt_number("Enter temperature in Kelvin >=0: ",{0,4294967296})
|
||||
printf(1,"K = %5.2f\nC = %5.2f\nF = %5.2f\nR = %5.2f\n\n",{K,K-273.15,K*1.8-459.67,K*1.8})
|
||||
end while
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
(function kelvin-conversions K
|
||||
(let [C R F] ((juxt K->C K->R K->F) K)
|
||||
[C R F] (map @(round 2) [C R F]))
|
||||
(print K " K / " C " °C / " R " °R / " F " °F"))
|
||||
(print "{K} K / {C} °C / {R} °R / {F} °F"))
|
||||
|
||||
(kelvin-conversions 21.0)
|
||||
;prints "21 K / -252.15 °C / 37.8 °R / -421.87 °F"
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
function temp($k){
|
||||
try{
|
||||
$c = $k - 273.15
|
||||
$r = $k / 5 * 9
|
||||
$f = $r - 459.67
|
||||
} catch {
|
||||
Write-host "Input error."
|
||||
return
|
||||
}
|
||||
|
||||
Write-host ""
|
||||
Write-host " TEMP (Kelvin) : " $k
|
||||
Write-host " TEMP (Celsius) : " $c
|
||||
Write-host " TEMP (Fahrenheit): " $f
|
||||
Write-host " TEMP (Rankine) : " $r
|
||||
Write-host ""
|
||||
|
||||
}
|
||||
|
||||
$input=Read-host "Enter a temperature in Kelvin"
|
||||
temp $input
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
function Convert-Kelvin
|
||||
{
|
||||
[CmdletBinding()]
|
||||
[OutputType([PSCustomObject])]
|
||||
Param
|
||||
(
|
||||
[Parameter(Mandatory=$true,
|
||||
ValueFromPipeline=$true,
|
||||
ValueFromPipelineByPropertyName=$true,
|
||||
Position=0)]
|
||||
[double]
|
||||
$InputObject
|
||||
)
|
||||
|
||||
Process
|
||||
{
|
||||
foreach ($kelvin in $InputObject)
|
||||
{
|
||||
[PSCustomObject]@{
|
||||
Kelvin = $kelvin
|
||||
Celsius = $kelvin - 273.15
|
||||
Fahrenheit = $kelvin * 1.8 - 459.67
|
||||
Rankine = $kelvin * 1.8
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
21, 100 | Convert-Kelvin
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
WScript.StdOut.Write "Enter the temperature in Kelvin:"
|
||||
tmp = WScript.StdIn.ReadLine
|
||||
|
||||
WScript.StdOut.WriteLine "Kelvin: " & tmp
|
||||
WScript.StdOut.WriteLine "Fahrenheit: " & fahrenheit(CInt(tmp))
|
||||
WScript.StdOut.WriteLine "Celsius: " & celsius(CInt(tmp))
|
||||
WScript.StdOut.WriteLine "Rankine: " & rankine(CInt(tmp))
|
||||
|
||||
Function fahrenheit(k)
|
||||
fahrenheit = (k*1.8)-459.67
|
||||
End Function
|
||||
|
||||
Function celsius(k)
|
||||
celsius = k-273.15
|
||||
End Function
|
||||
|
||||
Function rankine(k)
|
||||
rankine = (k-273.15)*1.8+491.67
|
||||
End Function
|
||||
Loading…
Add table
Add a link
Reference in a new issue