% These rates are in percent
const GSTrate: real := 7
const PSTrate: real := 8

const GSTfactor := GSTrate / 100
const PSTfactor := PSTrate / 100

var price, GST, PST: real

% Get the retail price
put "price?  " ..
get price

% Compute those darned taxes
GST := price * GSTfactor
PST := price * PSTfactor

%
% The following makes use of formatted "put"
% statements.  The command
%
% 	put A : n
%
% means to put the variable A so that it occupies
% n columns.
%
% If r is a "real", then we can also say how
% many decimal places it should occupy after
% a second colon.  So
%
%	put r : 10 : 3
%
% says to print r using 10 columns and 3 decimal
% places.  One extra column is taken up by a "."
%
put "Before tax price " : 20, "$", price : 8 : 2
put "GST" : 20, "$", GST : 8 : 2
put "PST" : 20, "$", PST : 8 : 2
put "After tax price " : 20, "$", price+GST+PST : 8 : 2
