-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCUP.PAS
80 lines (69 loc) · 2.25 KB
/
CUP.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{ @author: Sylvain Maltais (support@gladir.com)
@created: 2023
@website(https://www.gladir.com/alimbase)
@abstract(Target: Turbo Pascal 7, Free Pascal 3.2)
}
Program CUP;
Var
Value:Real;
Err:Word;
BEGIN
If(ParamStr(1)='/?')or(ParamStr(1)='--help')or(ParamStr(1)='-h')or
(ParamStr(1)='/h')or(ParamStr(1)='/H')Then Begin
WriteLn('CUP : Cette commande permet de convertir une unit‚ de mesure ',
'de tasse en son ‚quivalent.');
WriteLn;
WriteLn('Syntaxe : CUP valeur');
WriteLn;
WriteLn(' valeur Ce parametre permet d''indiquer la valeur a convertir');
End
Else
Begin
Val(ParamStr(1),Value,Err);
If Frac(Value)=0.0 Then Begin
WriteLn(Value:0:0,' tasse = ',Value*0.25:0:2,' litre');
End
Else
WriteLn(Value:0:2,' tasse = ',Value*0.25:0:2,' litre');
If Frac(Value)=0.0 Then Begin
WriteLn(Value:0:0,' tasse = ',Value*25:0:2,' centilitre (cl)');
End
Else
WriteLn(Value:0:2,' tasse = ',Value*25:0:2,' centilitre (cl)');
If Frac(Value)=0.0 Then Begin
WriteLn(Value:0:0,' tasse = ',Value*250:0:2,' millilitre (ml)');
End
Else
WriteLn(Value:0:2,' tasse = ',Value*250:0:2,' millilitre (ml)');
If Frac(Value)=0.0 Then Begin
WriteLn(Value:0:0,' tasse = ',Value*61.023744/4:0:6,' pouce cube (cu in)');
End
Else
WriteLn(Value:0:2,' tasse = ',Value*61.023744/4:0:2,' pouce cube (cu in)');
If Frac(Value)=0.0 Then Begin
WriteLn(Value:0:0,' tasse = ',Value*50.0:0:6,' cuillŠre … caf‚');
End
Else
WriteLn(Value:0:2,' tasse = ',Value*50.0:0:6,' cuillŠre … caf‚');
If Frac(Value)=0.0 Then Begin
WriteLn(Value:0:0,' tasse = ',Value*16.666667:0:3,' cuillŠre … soupe');
End
Else
WriteLn(Value:0:2,' tasse = ',Value*16.666667:0:3,' cuillŠre … soupe');
If Frac(Value)=0.0 Then Begin
WriteLn(Value:0:0,' tasse = ',Value*0.054992:0:6,' gallon imp‚rial');
End
Else
WriteLn(Value:0:2,' tasse = ',Value*0.054992:0:6,' gallon imp‚rial');
If Frac(Value)=0.0 Then Begin
WriteLn(Value:0:0,' tasse = ',Value*8.79877:0:6,' once liquide');
End
Else
WriteLn(Value:0:2,' tasse = ',Value*8.79877:0:6,' once liquide');
If Frac(Value)=0.0 Then Begin
WriteLn(Value:0:0,' tasse = ',Value*0.000327:0:6,' stŠre');
End
Else
WriteLn(Value:0:2,' tasse = ',Value*0.000327:0:6,' stŠre');
End;
END.