Advertisement
Guest User

701.3

a guest
Dec 12th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 KB | None | 0 0
  1. /*
  2.  
  3. Officer: shass013
  4. CaseNum: 701-2-60819448-1699061
  5.  
  6. Case 701 - Recognisable robber - stage 3
  7.  
  8. Kid you’re becoming a victim of your own success.
  9. I just had a call from DI Max down at the precinct. He specifically requested your services.
  10. They finally have a reliable witness for a robber who has been causing mayhem for some months.
  11. Luckily they have a witness statement from kitty adversane. You know what to do kid.
  12.  
  13. Please create a function that takes a suspect object as parameter from the data structure below.
  14. Your function should return a number value indicating how many of their properties match the witness statement.
  15. You should use conditional statements to compare the suspect's properties to the statement.
  16.  
  17. The function is already being called in draw() but it is your job to implement it.
  18.  
  19. There are many possible ways of carrying out your duties,
  20. but you should complete this task using ONLY the following
  21. commands:
  22.  
  23. - function matchSuspect(suspectObj){}
  24. - if()
  25.  
  26. Witness statement:
  27.  
  28. I remember walking down the street and then I saw them. It's so hard to remember right now. I distinctly remember that they were wearing a purple hat, I remember thinking that was quite unusual. They brobably weigh between 71 and 74 kg. They seemed to be between the age of 19 and 41 years old. They were fairly tall, I think between a height of 149 and 190 cm. They had thin blond hair. I remember they had a bull tattoo. They were carrying a metal briefcase. It was so scary! I'll never forget their brown eyes. That's all I can remember about them.
  29.  
  30. */
  31.  
  32. var lineupLog = [
  33. {
  34. "name": "LARRAINE MONKSFORD",
  35. "accessory": "laptop bag",
  36. "eyes": "blue",
  37. "tattoo": "facial",
  38. "item": "net weave shirt",
  39. "age": 52,
  40. "height": 184,
  41. "weight": 75
  42. },
  43. {
  44. "name": "LINETTE BROADVIEW",
  45. "accessory": "metal briefcase",
  46. "eyes": "brown",
  47. "tattoo": "bull",
  48. "item": "purple hat",
  49. "age": 26,
  50. "height": 169,
  51. "weight": 73
  52. },
  53. {
  54. "name": "RANDEE TINTLE",
  55. "accessory": "big black envelope",
  56. "eyes": "brown",
  57. "tattoo": "anchor",
  58. "item": "pair of leather trousers",
  59. "age": 46,
  60. "height": 155,
  61. "weight": 72
  62. },
  63. {
  64. "name": "JESUS PHINNEY",
  65. "accessory": "black duffle bag",
  66. "eyes": "green",
  67. "tattoo": "ox",
  68. "item": "fur vest",
  69. "age": 37,
  70. "height": 196,
  71. "weight": 84
  72. },
  73. {
  74. "name": "JAUNITA JOYER",
  75. "accessory": "brown paper bag",
  76. "eyes": "black",
  77. "tattoo": "chinese lettering",
  78. "item": "pink scarf",
  79. "age": 46,
  80. "height": 175,
  81. "weight": 63
  82. },
  83. {
  84. "name": "LIANNE FORSLIN",
  85. "accessory": "glass bottle",
  86. "eyes": "black",
  87. "tattoo": "dark black",
  88. "item": "dotted necktie",
  89. "age": 38,
  90. "height": 154,
  91. "weight": 67
  92. },
  93. {
  94. "name": "JESSIA NIEMELA",
  95. "accessory": "orange plasic bag",
  96. "eyes": "blue",
  97. "tattoo": "big arrow",
  98. "item": "red necktie",
  99. "age": 49,
  100. "height": 152,
  101. "weight": 69
  102. }
  103. ];
  104.  
  105. var myFont;
  106. var backgroundImg;
  107.  
  108. function preload() {
  109. myFont = loadFont('SpecialElite.ttf');
  110. backgroundImg = loadImage("Background.png");
  111. }
  112.  
  113. function setup()
  114. {
  115. createCanvas(640,480);
  116. }
  117.  
  118. // Declare your function here
  119.  
  120. function matchSuspect(suspectObj){
  121.  
  122. if (lineupLog.hat == "purple hat")
  123. {
  124.  
  125. }
  126. else
  127. {
  128. return 0
  129. }
  130.  
  131.  
  132.  
  133.  
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement