Guest User

Untitled

a guest
May 26th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. CashRegister
  2. Properties
  3. PriceList Array of objects the individual objects the properties specified in the product class below
  4. MoneyReceived
  5. Last Item Scanned
  6. CurrentTransaction - Transaction
  7. PriorTransactions - Array of Transaction objects
  8. Current cash in the cash register - Money object
  9. InTransaction boolean
  10. CurrentTransactionID
  11. CurrentTransactionDateTime
  12. Methods
  13. Intialize(PriceList String, Money object, salestax number) {
  14. split the pricelist string on commas
  15. loop through the list three at a time and store them into product objects and push into array of pricelist
  16. }
  17. Total() {
  18. sum the total amounts in the cash register by calling total on the money object and return
  19. }
  20. StartTransaction() {
  21. InTransaction = true
  22. CurrentTransaction = new Transaction
  23. CurrentTransactionID++
  24. CurrentTransactionDateTime = now()
  25. }
  26. EndTransaction() {
  27. InTransaction = false
  28. PriorTransactions.push(CurrentTransaction)
  29. calculate total and return
  30. }
  31. ScanItem(SKU string) {
  32. CurrentTransaction.Add(CurrentTransactionID, TimeStamp, SKU)
  33. FindItem using SKU on pricelist
  34. Add Item to list and update quantity
  35. }
  36.  
  37. Money - Class consisting of number bills of a particular type
  38. Properties
  39. cash array of money units
  40. Methods
  41. Total() {
  42. add up the array using value * quantity above and return total
  43. }
  44. Add(amounts) {
  45. take an array of amounts and matches to the cash array and subtracts the appropriate quantity from the corresponding index
  46. }
  47. Subtract(amounts) {
  48. figures out the least number of units that need to be substracted and subtracts from the corresponding index
  49. }
  50.  
  51. MoneyUnit - Class contains a cash type and its value and the quantity
  52. Properties
  53. var cashtype = string
  54. var value = number
  55. var quantity = number
  56.  
  57. PriceList - Class containing array of product objects
  58. Properties
  59. Array of Products
  60.  
  61. Product - Class for objects stored in the price list on the cash register
  62. Properties
  63. Product Name
  64. SKU - Product ID
  65. Price per unit
  66. Taxable?
  67.  
  68. Transaction
  69. Properties
  70. Transaction ID
  71. Time Stamp
  72. Scanned Products Array
  73.  
  74. Cashier
  75.  
  76. Customer
  77.  
  78. Receipt
  79. Properties
  80. Product Name
  81. Number of items purchased
  82. Price
  83. Total
  84.  
  85. Cashier Report
  86. Properties
  87. ID
  88. Number of items purchased
  89. Total
Add Comment
Please, Sign In to add comment