Complete the following function definition:
;; add-tax : Number -> Number
;; add the sales tax to a given amount;
;; assume the sales tax rate is 5%
(define (add-tax net-amount)
)
;; Examples/tests:
(equal? (add-tax 100) 105)
(equal? (add-tax 200) 210)
Solution:
;; [PT 1] for one of these (or equivalent): (* 1.05 net-amount) or (+ net-amount (* .05 net-amount))
What will DrScheme's Interactions Window show when you run this complete program:
(define NAME "Matthias")
;; closing : String -> String
;; create a closing for a letter,
;; given the closing phrase
(define (closing txt) (string-append txt " \n" NAME))
(string=? (closing "Sincerely")
"Sincerely \nMatthias")
;; one could also test, but I won't:
;; (string=? (closing "Regards,")
;; "Regards, \nMatthias")
Solution: true ;; [PT 1]