Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Luke Bas
- %Oct. 5 2017
- %Assignment 2
- %This program gives you a receipt of an order of an item you buy.
- var answer1, name1, business, country : string
- var num1, ordernum : int
- var Canada : string
- var America :string
- var ordernum2, postage : real
- var hst : real
- put "Hello, you are here to purchase the all new Staff of destruction correct? Before we start your order, I need some information to be able to execute the order."
- put "First, i will need your first name, please type it in"
- get name1
- put "Hello, ", name1
- put "Please give me your business name"
- get business
- loop
- put "What country do you reside in, America or Canada?"
- get country
- if country = "Canada" then
- put "Here is the correct info ", name1, " ,", business, " ,", country
- exit
- elsif country = "America" then
- put "Here is the correct info ", name1, " ,", business, " ,", country
- exit
- else
- put "That is not a valid country for this order"
- end if
- end loop
- randint (num1, 1000, 9999)
- put "This is your invoice number"
- put num1
- put "The price of the Staff of destruction is $76.55"
- delay (3000)
- put "How many staffs of destruction would you like to order?"
- get ordernum
- put "Your total for amount of product is " ..
- ordernum2 := ordernum * 76.55
- put "$", ordernum2
- if country = "America" then
- put "This is your Grandtotal with your postage fee"
- else
- put "This is your subtotal with your postage fee " ..
- end if
- if ordernum2 <= 100 then
- put "$", ordernum2 + 15
- postage := 15
- elsif ordernum2 > 100 then
- put "$", ordernum2 + 30
- postage := 30
- elsif ordernum2 >= 500 then
- put "$", ordernum2 + 50
- postage := 50
- end if
- if country = "Canada" then
- put "This is your Grandtotal with everything including 13% HST (since you're Canadian)."
- hst := ordernum2 * .13
- put "$", ordernum2 + hst
- else
- put "No HST tax for you are American"
- end if
- put " "
- put " "
- put " "
- put "Hold on while your receipt is printed"
- delay (10000)
- cls
- put "Here is the full receipt"
- put repeat ("*", 80)
- put " STAFF OF DESTRUCTION"
- put " Cost: $76.55"
- put " "
- put "Customer name:"," ",name1
- put "Business name:"," ",business
- put "Country:"," ",country
- put "Invoice number:"," ",num1
- put "Number of items ordered:"," ",ordernum
- put " "
- put "Total cost of items:"," ","$",ordernum2 :2
- put "Postage and handling:"," ","$",postage
- put " ","------"
- put "Subtotal:"," ","$",postage + ordernum2 :2
- put " "
- if country = "Canada" then
- put "13% HST:"," ","$",hst :2
- put " ","------"
- else
- put "13% HST:"," ","$",0
- put " ","------"
- end if
- if country = "America" then
- put "Grand Total:"," ","$",ordernum2 + postage :2
- else
- put "Grand Total:"," ","$",ordernum2 + postage + hst :2
- end if
- put " "
- put " Have fun crushing your enemies!"
- put repeat ("*",80)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement