title "DiscountCalc"
fo.
100
c.
in. "Enter Regular Price ";a!
if a!=0 th. g. 400
c.
in. "Enter Tax Rate ";b!
c.
if b!=0 th. b!=8.25
c!=0.01*b!
REM calculate/round regular tax
d!=c!*a!
d!=100*d!
y!=dint! d!
if y!<0.0 th. g. 105
z!=d!-y!
if z!>0.5 th. z!=1
if z!<0.5 th. z!=0
if z!=0.5 th. z!=1
d!=y!+z!
105
d!=0.01*d!
REM calculate regular price and tax total
e!=a!+d!
REM query and direct
p. "Enter Discount %"
in. "Or 0 To Enter Discount $";x!
c.
if x!>0 th. g. 200
in. "Enter Discount Price ";f!
c.
REM calculate/round discount tax
g!=c!*f!!
g!=100*g!
y!=dint! g!
if y!<0.0 th. g. 110
z!=g!-y!
if z!>0.5 th. z!=1
if z!<0.5 th. z!=0
if z!=0.5 th. z!=1
g!=y!+z!
110
g!=0.01*g!
REM calculate discount price and tax total
h!=f!+g!
REM calculate savings (price, tax, total, percent)
i!=a!-f!
j!=d!-g!
k!=e!-h!
l!=100-(100*(f!/a!))
REM round percent
l!=100*l!
y!=dint! l!
if y!<0.0 th. g. 115
z!=l!-y!
if z!>0.5 th. z!=1
if z!<0.5 th. z!=0
if z!=0.5 th. z!=1
l!=y!+z!
115
l!=0.01*l!
g. 300
200
REM assign discount percent
l!=x!
REM calculate/round discount price
f!=a!-((0.01*l!)*a!)
f!=100*f!
y!=dint! f!
if y!<0.0 th. g. 205
z!=f!-y!
if z!>0.5 th. z!=1
if z!<0.5 th. z!=0
if z!=0.5 th. z!=1
f!=y!+z!
205
f!=0.01*f!
REM calculate/round discount tax
g!=c!*f!!
g!=100*g!
y!=dint! g!
if y!<0.0 th. g. 210
z!=g!-y!
if z!>0.5 th. z!=1
if z!<0.5 th. z!=0
if z!=0.5 th. z!=1
g!=y!+z!
210
g!=0.01*g!
REM calculate discount price and tax total
h!=f!+g!
REM calculate savings (price, tax, total)
i!=a!-f!
j!=d!-g!
k!=e!-h!
300
p. "Regular Price"
p. "$";a!;" + $";d!;" = $";e!
p.
p. "Discount Price"
p. "$";f!;" + $";g!;" = $";h!
p.
p. "Savings (";l!;"%)"
p. "$";i!;" + $";j!;" = $";k! 
pa.
g. 100
400
c.
p. "Notes"
p.
p.
p. "Enter 0 or tap screen to"
p. "continue."
p.
p. "Enter 0 as Tax Rate to"
p. "use preset rate."
p.
p. "Use calculator screen to"
p. "calculate."
p.
p. "Heed minor discrepencies"
p. "resulting from rounding."
pa.
goto 100


