Price fraction: Difference between revisions

Added QB64
(Added Chipmunk Basic)
(Added QB64)
 
Line 934:
=={{header|BASIC}}==
{{works with|QBasic}}
{{works with|QB64}}
This could also be done by building an array, but I felt that this was simpler.
 
Line 1,330 ⟶ 1,331:
0.2292 -> 0.38
0.9560 -> 1.00</pre>
 
==={{header|QB64}}===
{{trans|Gambas}}
<syntaxhighlight lang="vbnet">Data 10,18,26,32,38,44,50,54,58,62,66,70,74,78,82,86,90,94,98,100
Data 6,11,16,21,26,31,36,41,46,51,56,61,66,71,76,81,86,91,96
Dim od(21)
For i = 1 To 20
Read olddec
od(i) = olddec
Next i
Dim nd(20)
For j = 1 To 19
Read nuedec
nd(j) = nuedec
Next j
For i = 1 To 100
For j = 1 To UBound(nd) - 1
If i < nd(j) Then Exit For
Next j
Print Using "#.## -> #.##"; (i / 100); (od(j) / 100);
If i Mod 5 = 0 Then Print Else Print Chr$(9);
Next i</syntaxhighlight>
 
==={{header|Run BASIC}}===
2,169

edits