Advertisement
ledroran

Untitled

Sep 10th, 2018
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.47 KB | None | 0 0
  1. ; Alejandro Roldan
  2. ; fecha: 10 septiembre del 2018
  3. ; contrato edad : numero numero  --> simbolo
  4. ; proposito: este programa recibe un numero  lo compara con otro y  retorna su diferencia
  5. ;;ejemplo: (chequear-numeros 2 3 --> 'pequeño)
  6. (define (chequear-numeros a b)
  7. (cond
  8. [(= a b) 'iqual ]
  9. [(and (< 0 (abs (- a b))) (>=  999 (abs (- a b )))) 'small]
  10. [else 'lots]
  11. ))
  12.  ;;pruebas
  13. (check-expect (chequear-numeros 1 14)'small)
  14. (check-expect (chequear-numeros 1 140000)'lots)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement