title "FoodCalc"
fo.
100
cl. a!
cl. b!
cl. c!
cl. p!
cl. q!
cl. r!
cl. s!
cl. t!
c.
p. "Enter Item 1 Price"
in. "Or 0 For Calorie Entry ";a!
if a!>0 th. g. 200
c.
REM create item loop
for w=1 to 5
c.
if a!>0 th. g. 105
p. "Enter Item ";w;" Calories"
in. "Per Measure ";a!
105
c.
p. "Enter Item ";w; " Fat Calories "
in. "Per Measure ";b!
c.
c!=100*b!/a!
REM round fat calories percent
c!=100*c!
y!=dint! c!
if y!<0.0 th. g. 110
z!=c!-y!
if z!>0.5 th. z!=1
if z!<0.5 th. z!=0
if z!=0.5 th. z!=1
c!=y!+z!
110
c!=0.01*c!
REM fill item totals
If w=1 th. p!=c!
If w=2 th. q!=c!
If w=3 th. r!=c!
If w=4 th. s!=c!
If w=5 th. t!=c!
If w=5 th. g. 150
cl. c!
x=w+1
REM inquire and direct
c.
p. "Enter Item ";x;" Calories"
in. "Per Measure";a!
c.
if a!=0 th. g. 150
n.
150
c.
p. "Calories From Fat"
p.
p. "Item 1  ";p!;"%"
if q!>0 th. p. "Item 2  ";q!;"%"
if r!>0 th. p. "Item 3  ";r!;"%"
if s!>0 th. p. "Item 4  ";s!;"%"
if t!>0 th. p. "Item 5  ";t!;"%"
pa.
g. 100
200
REM create item loop
for w=1 to 5
c.
p. "Enter Item ";w;" Total Units"
in. "Measure";b!
c.
c!=a!/b!
REM round price per measure
c!=1000*c!
y!=dint! c!
if y!<0.0 th. g. 205
z!=c!-y!
if z!>0.5 th. z!=1
if z!<0.5 th. z!=0
if z!=0.5 th. z!=1
c!=y!+z!
205
c!=0.001*c!
REM fill item totals
If w=1 th. p!=c!
If w=2 th. q!=c!
If w=3 th. r!=c!
If w=4 th. s!=c!
If w=5 th. t!=c!
If w=5 th. g. 300
cl. c!
x=w+1
REM inquire and direct
c.
p. "Enter Item ";x;" Price"
in. "$";a!
c.
if a!=0 th. g. 300
n.
300
c.
p. "Price Per Measure"
p.
p. "Item 1  $";p!
if q!>0 th. p. "Item 2  $";q!
if r!>0 th. p. "Item 3  $";r!
if s!>0 th. p. "Item 4  $";s!
if t!>0 th. p. "Item 5  $";t!
pa.
g. 100