CS计算机代考程序代写 (display “############# STARTING TEST CASE #############\n”)

(display “############# STARTING TEST CASE #############\n”)
(display “************************************”)
(newline)
(display “Testing run functions”)
(newline)
(display “(run1) – answer should be 6 – tested: “)
(run1)
(display “(run2) – answer should be 43 1/2 – tested: “)
(run2)
(display “(run3) – answer should be -7 – tested: “)
(run3)
(display “(run4) – answer should be 45 – tested: “)
(run4)
(display “(run5) – answer should be 45 – tested: “)
(run5)

(display “\n############# FINAL FANTASY CASE #############\n”)
(display “Testing FF6 Damamge\n”)
(display “(how-much-damage-ff6? 100 100) – expected 61 – got: “) (how-much-damage-ff6? 100 100)

(display “Testing FF7 Damamge\n”)
(display “(base-attack-ff7 20 18) – expected 38 – got: “) (base-attack-ff7 20 18)
(display “(base-damage-ff7 6 38) – expected 45 – got: “) (base-damage-ff7 6 38)

;;;base damage with function
(display “(base-damage-ff7 6 (base-attack-ff7 20 18)) – expected 45 – got: “) (base-damage-ff7 6 (base-attack-ff7 20 18))

;;;calculate power
(display “(calculate-power-ff7 16 45) – expected 45 – got: “) (calculate-power-ff7 16 45)

;;; how much damage
(display “(how-much-damage-ff7? 4 45) – expected 44 – got: “) (how-much-damage-ff7? 4 45)

(display “(get-attack-damage-ff7 6 20 18 16 4) – expected 44 – got: “) (get-attack-damage-ff7 6 20 18 16 4)

(display “Testing List Cuts”)(newline)
(display “(get-second-item ‘(1 2 3 4)) – epxected 2 – got: “)
(get-second-item ‘(1 2 3 4))
(display “(get-third-item ‘(1 2 3 4)) – epxected 3 – got: “)
(get-third-item ‘(1 2 3 4))
(display “(list-length? ‘(1 2 3 4)) – epxected 4 – got: “)
(list-length? ‘(1 2 3 4))
(display “(list-length? ‘(1 2 (1 2 3 4) a (1 2 3 4))) – epxected 5 – got: “)
(list-length? ‘(1 2 (1 2 3 4) a (1 2 3 4)))
(display “arbitrary-cdr 3 ‘(a b c d e)) – epxected ‘(c d e) – got: “)
(arbitrary-cdr 3 ‘(a b c d e))
(display “arbitrary-cdr 7 ‘(a b c d e)) – epxected #f – got: “)
(arbitrary-cdr 7 ‘(a b c d e))

(display “Testing number-list?”)(newline)
(display “(number-list? ‘(1 2 3 4) – epxected #t – got: “)
(number-list? ‘(1 2 3 4))
(display “(number-list? ‘(1 2 (3) 4) – expected #f – got: “)
(number-list? ‘(1 2 (3) 4))
(display “(number-list? ‘(1 2 a 4) – expected #f – got: “)
(number-list? ‘(1 2 a 4))

(newline)
(display “Testing sum-number-list”)(newline)
(display “(sum-number-list ‘(1 2 3 4 5) – expected 15 – got: “)
(sum-number-list ‘(1 2 3 4 5))
(display “(sum-number-list ‘(1 (2))) – expected #f – got: “)
(sum-number-list ‘(1 (2)))
(display “(sum-number-list ‘(a b c)) – expected #f – got: “)
(sum-number-list ‘(a b c))