All pastes #916990 Raw Edit

Miscellany

public text v1 · immutable
#916990 ·published 2008-02-25 01:56 UTC
rendered paste body
/*
    Assignment # 1
    By Kyle VE
    For ICS3M
    February 20th
*/

var itemnumb : int      % The current item you are on
var totnumbs : int      % Total number of items to be entered
var amnt : real         % The amount of money
var amnttot : real      % The total amount of money
var GST : real          % The value for GST
var PST : real          % The value for PST

GST := 0.07             % Set the GST to 7% as a decimal
PST := 0.08             % Set the PST to 8% as a decimal

loop                    % Loop until the user enters less then 10 as total nuber of items.
put "Please enter the number of item(s) you want: "..
get totnumbs
cls
exit when totnumbs < 11
end loop

cls

itemnumb := 0                   % set the number of items to 0
amnttot := 0                    % set the total monentary value to 0

loop                            % loop through so the user can enter all their choices
put "Please enter item #", itemnumb + 1, ": "..
get amnt                        % get the value of the item
amnttot := amnttot + amnt       % add the current item's value to the total value
itemnumb := itemnumb + 1        % current item counter
exit when itemnumb = totnumbs   % exit the loop when the user enters all the items
end loop

cls
put "You entered a total of $", amnttot, ". The total, including tax is: $", ((GST + PST + 1) * (amnttot)):8:2
% Put the total amount entered, and then the amount, with tax, terminated to two decimals.