Check for Mistakes in this Word Problem: equal-length?
Directions: Write a function that takes in two strings and returns true if their lengths are equal and false otherwise.
Contract and Purpose Statement
Every contract has three parts ...
;equal-length?:string string→boolean
; Given two strings, check if they are the same length
Examples
Write some examples, then circle and label what changes ...
(EXAMPLE (equal-length?("yes" "no"))(= (string-length "yes") (string-length "no"))
(EXAMPLE (equal-length?("dog" "cat"))(= (string-length "dog") (string-length "cat"))
Definition
Write the definition, giving variable names to all your input values ...
(define (equal-length?string1 string2)(= string1 string2))