I'm trying to figure out a question that takes a list of first names and a list of last name and create a new list of email addresses with the first letter of the first name and up to 7 letters of the last name and @yahoo.com.
example:
(check-expect
(emails-list (list "John" "Sarah") (list "King" "Dickinson"))
(list "jking@yahoo.com" "sdickins@yahoo.com"))
(check-expect (emails-list empty empty) empty)
So far I have:
(define (appendnames alof alos)
(cond [(and (empty? alof) (empty? alos)) empty]
[else (string-append
(substring (first alof) 0 1)
(cond [(< (string-length (first alos)) 8) (first alos)]
[else (substring (first alos) 0 7)])
"@yahoo.com")]))
(define (emails-list alof alos)
(cond [(and (empty? alof) (empty? alos)) empty]
[else (appendnames alof alos)]))
What I don't know how to do is how to make the first letters lowercase and where to put in the recursion so that appendnames will (appendnames (rest alof) (rest alos)).
Thanks so much for any help I can get!