Check for Mistakes in this Word Problem: enough-cash?
Directions: You go the store with $1.50 in your pocket. Write a function which takes in the price of an item and returns true if you have enough money to buy the item and false if you do not.
Contract and Purpose Statement
Every contract has three parts ...;
Check to see if the item costs less than 1.50
Write some examples, then circle and label what changes ...(EXAMPLE (
enough-cash?"gum")(< gum 1.5)(EXAMPLE (
enough-cash?"soda")(< gum 150)
Write the definition, giving variable names to all your input values ...(define (
enough-cash?item)(< item 1.5))