Advertisement
IBeetle

Untitled

Dec 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. %Luke Bas
  2. %Oct. 5 2017
  3. %Assignment 2
  4. %This program gives you a receipt of an order of an item you buy.
  5. var answer1, name1, business, country : string
  6. var num1, ordernum : int
  7. var Canada : string
  8. var America :string
  9. var ordernum2, postage : real
  10. var hst : real
  11. 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."
  12. put "First, i will need your first name, please type it in"
  13. get name1
  14. put "Hello, ", name1
  15. put "Please give me your business name"
  16. get business
  17. loop
  18. put "What country do you reside in, America or Canada?"
  19. get country
  20. if country = "Canada" then
  21. put "Here is the correct info ", name1, " ,", business, " ,", country
  22. exit
  23. elsif country = "America" then
  24. put "Here is the correct info ", name1, " ,", business, " ,", country
  25. exit
  26. else
  27. put "That is not a valid country for this order"
  28. end if
  29. end loop
  30. randint (num1, 1000, 9999)
  31. put "This is your invoice number"
  32. put num1
  33. put "The price of the Staff of destruction is $76.55"
  34. delay (3000)
  35. put "How many staffs of destruction would you like to order?"
  36.  
  37. get ordernum
  38. put "Your total for amount of product is " ..
  39. ordernum2 := ordernum * 76.55
  40. put "$", ordernum2
  41. if country = "America" then
  42. put "This is your Grandtotal with your postage fee"
  43. else
  44. put "This is your subtotal with your postage fee " ..
  45. end if
  46. if ordernum2 <= 100 then
  47. put "$", ordernum2 + 15
  48. postage := 15
  49. elsif ordernum2 > 100 then
  50. put "$", ordernum2 + 30
  51. postage := 30
  52. elsif ordernum2 >= 500 then
  53. put "$", ordernum2 + 50
  54. postage := 50
  55. end if
  56. if country = "Canada" then
  57. put "This is your Grandtotal with everything including 13% HST (since you're Canadian)."
  58. hst := ordernum2 * .13
  59. put "$", ordernum2 + hst
  60. else
  61. put "No HST tax for you are American"
  62. end if
  63. put " "
  64. put " "
  65. put " "
  66. put "Hold on while your receipt is printed"
  67. delay (10000)
  68. cls
  69. put "Here is the full receipt"
  70. put repeat ("*", 80)
  71. put " STAFF OF DESTRUCTION"
  72. put " Cost: $76.55"
  73. put " "
  74. put "Customer name:"," ",name1
  75. put "Business name:"," ",business
  76. put "Country:"," ",country
  77. put "Invoice number:"," ",num1
  78. put "Number of items ordered:"," ",ordernum
  79. put " "
  80. put "Total cost of items:"," ","$",ordernum2 :2
  81. put "Postage and handling:"," ","$",postage
  82. put " ","------"
  83. put "Subtotal:"," ","$",postage + ordernum2 :2
  84. put " "
  85. if country = "Canada" then
  86. put "13% HST:"," ","$",hst :2
  87. put " ","------"
  88. else
  89. put "13% HST:"," ","$",0
  90. put " ","------"
  91. end if
  92. if country = "America" then
  93. put "Grand Total:"," ","$",ordernum2 + postage :2
  94. else
  95. put "Grand Total:"," ","$",ordernum2 + postage + hst :2
  96. end if
  97. put " "
  98. put " Have fun crushing your enemies!"
  99. put repeat ("*",80)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement