Advertisement
Guest User

Untitled

a guest
Nov 6th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Racket 6.02 KB | None | 0 0
  1. 3a)
  2. (check-expect
  3.  (add-perks "Steve Li" (list
  4.                         (list 30 "I don't know what to write here")
  5.                         (list 9 "or here"))
  6.             short-perklist)
  7.  (list
  8.    (list "Peter Smith" (list
  9.                         (list 83 "50,000 dollars campaign funding")
  10.                         (list 32 "Public support by your company")
  11.                         (list 13 "Opera tickets")))
  12.    (list "Jennifer O'Brien" (list
  13.                              (list 137 "Position on the Board of Directors")
  14.                              (list 22 "Arranging photo-op with CEO")))
  15.    (list "Steve Li" (list
  16.                      (list 91 "Sponsored TV ads")
  17.                      (list 56 "Invitation as keynote-speaker")
  18.                      (list 30 "I don't know what to write here")
  19.                      (list 9 "or here")
  20.                      (list 5 "Business dinner with CTO")))))
  21.  
  22. (check-expect
  23.  (add-perks "Jayce Jung" (list
  24.                           (list 100 "I love food")
  25.                           (list 20 "I love sleep"))
  26.             empty)
  27.  (list
  28.   (list "Jayce Jung" (list
  29.                        (list 100 "I love food")
  30.                        (list 20 "I love sleep")))))
  31.  
  32. (check-expect
  33.  (add-perks "Jayce Jung" (list
  34.                           (list 100 "I love food")
  35.                           (list 20 "I love sleep"))
  36.             short-perklist)
  37.   (list
  38.    (list "Peter Smith" (list
  39.                         (list 83 "50,000 dollars campaign funding")
  40.                         (list 32 "Public support by your company")
  41.                         (list 13 "Opera tickets")))
  42.    (list "Jennifer O'Brien" (list
  43.                              (list 137 "Position on the Board of Directors")
  44.                              (list 22 "Arranging photo-op with CEO")))
  45.    (list "Steve Li" (list
  46.                      (list 91 "Sponsored TV ads")
  47.                      (list 56 "Invitation as keynote-speaker")
  48.                      (list 9 "Positive press release in his favour")
  49.                      (list 5 "Business dinner with CTO")))
  50.    (list "Jayce Jung" (list
  51.                        (list 100 "I love food")
  52.                        (list 20 "I love sleep")))))
  53.  
  54. 3b)
  55. (check-expect (perk-received "Jayce Jung" 12 short-perklist)
  56.               'wristwatch)
  57. (check-expect (perk-received "Peter Smith" 100 short-perklist)
  58.               "50,000 dollars campaign funding")
  59. (check-expect (perk-received "Steve Li" -10 short-perklist)
  60.                'smear-campaign)
  61. (check-expect (perk-received "Jayce Jung" -10 short-perklist)
  62.               'smear-campaign)
  63.  
  64. 3c)
  65. (check-expect (add-action (list "Jayce Jung" 10 "Studied CS") short-ast)
  66.               (make-actionnode "Amanda Byers" -5
  67.               (list            
  68.               (list "Amanda Byers" -5 "Met with competitor"))
  69.               empty
  70.               (make-actionnode "Jayce Jung" 10
  71.               (list
  72.               (list "Jayce Jung" 10 "Studied CS")) empty empty)))
  73. (check-expect (add-action (list "Aaron Hong" 10 "Plays video game") short-ast)
  74.               (make-actionnode "Amanda Byers" -5
  75.               (list            
  76.               (list "Amanda Byers" -5 "Met with competitor"))
  77.               (make-actionnode "Aaron Hong" 10
  78.               (list
  79.               (list "Aaron Hong" 10 "Plays video game"))
  80.               empty empty)
  81.               empty))
  82. (check-expect (add-action
  83.               (list "Amanda Byers" -10
  84.                     "Does nothing")
  85.               short-ast)
  86.               (make-actionnode "Amanda Byers" -15
  87.               (list
  88.               (list "Amanda Byers" -10
  89.                     "Does nothing")
  90.               (list "Amanda Byers" -5 "Met with competitor")) empty empty))
  91.  
  92. 3d)
  93. (check-expect (perk-list
  94.               (make-actionnode "Amanda Byers" -5
  95.               (list (list "Amanda Byers" -5 "Met with competitor"))
  96.               empty
  97.               (make-actionnode "Steve Li" 12
  98.               (list (list "Steve Li" 12 "Plays golf with your second cousin"))
  99.               (make-actionnode "Jennifer O'Brien" 25
  100.               (list
  101.               (list "Jennifer O'Brien" 30 "Pushed major contract for your
  102.                     company")
  103.               (list "Jennifer O'Brien" 5 "Mentioned your company on
  104.                     morning TV")
  105.               (list "Jennifer O'Brien" -10 "Questioned your leadership in
  106.                     public"))
  107.               empty
  108.               empty)
  109.               empty))
  110.                short-perklist)
  111.  
  112.               (list
  113.               (list "Amanda Byers" 'smear-campaign)
  114.               (list "Jennifer O'Brien" "Arranging photo-op with CEO")
  115.               (list "Steve Li" "Positive press release in his favour")))
  116. (check-expect (perk-list
  117.               (make-actionnode "Amanda Byers" -5
  118.               (list (list "Amanda Byers" -5 "Met with competitor"))
  119.               empty              
  120.               (make-actionnode "Steve Li" 12
  121.               (list (list "Steve Li" 12 "Plays golf with your second cousin"))
  122.               (make-actionnode "Jennifer O'Brien" 25
  123.               (list
  124.               (list "Jennifer O'Brien" 30 "Pushed major contract for your
  125.                     company")
  126.               (list "Jennifer O'Brien" 5 "Mentioned your company on
  127.                     morning TV")
  128.               (list "Jennifer O'Brien" -10 "Questioned your leadership in
  129.                     public"))
  130.               empty
  131.               (make-actionnode "Peter Smith" 5
  132.               (list
  133.               (list "Peter Smith" -5 "Does nothing at home")
  134.               (list "Peter Smith" 10 "Does something at home"))
  135.               empty
  136.               empty))              
  137.               empty))                
  138.                short-perklist)
  139.  
  140.               (list
  141.               (list "Amanda Byers" 'smear-campaign)
  142.               (list "Jennifer O'Brien" "Arranging photo-op with CEO")
  143.               (list "Peter Smith" 'wristwatch)
  144.               (list "Steve Li" "Positive press release in his favour")))
  145. (check-expect (perk-list empty short-perklist) empty)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement