???
???

Check for Mistakes in this Word Problem: state-tax
Directions: Some states have different tax rates. New York is 8%, Pennsylvania is 3%, and Delaware is 0%. All other states are 5%. Write a function that takes in the price of an item and and returns how much the tax will be on the item.
Contract and Purpose Statement
Every contract has three parts ...
;
state-tax:stringnumber
;
Given the state and an item’s price, returns the the tax on that item
Examples
Write some examples, then circle and label what changes ...
(EXAMPLE (
(tax Delaware))(+ 0.0 price)
(EXAMPLE (
(tax Georgia))(+ 0.05 price)
Definition
Write the definition, giving variable names to all your input values ...
(define (
state-taxstate price)(
cond[
(string=? state "Pennsylvania")(* 0.03 price)
[
(string=? state "New York")(* 0.08 price)
[
(string=? state "Delaware")(* 0.0 price)
[
else(* 0.05 price)