So, i'm trying to write the following function in scheme, and to be able to run it on DrRacket. The problem is as follows,
make5 - takes two integers, and returns a 5-digit integer constructed of the rightmost 3 digits of the first input, and the leftmost 2 digits of the second input. For example, (make5 561432 254) would return 43225.
Negative signs on either input number should be ignored - that is, (make5 561432 -254) would also return 43225.
If the first number has less than three digits or the last three digits start with zeros, and/or the second number has less two digits, your function should return -2. Note: you may want to define some auxiliary functions.
So far this is the function I've been able to write.
(define (make5 x y) (cond ((< (length x) 3) -2) ((< (length y) 2) -2) (((modulo (abs(x)) 1000) 0) -2) (((modulo (abs(y)) 1000) 0) -2) (else (append (list-tail x 3) (cons (first(y)second(y))))))) I'm getting the error...
application: not a procedure; expected a procedure that can be applied to arguments
Any advice would be appreciated. I'm new to scheme and still trying to grasp everything.