Advertisement
ledroran

Untitled

Sep 10th, 2018
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.46 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, le compara con otro y  retorna su diferencia
  5. ;ejemplo ( chequear-diferencia  2 3 --> 'pequeño)
  6. ;;definicion
  7.  
  8.  
  9. (define (chequear-diferencia a b)
  10. (cond
  11. [(= a b) 'iqual ]
  12. [(and  (< 0 (abs (- a b))) (>= 10 (abs (- a b)))
  13. ) 'small ]
  14. [else 'grande]
  15. )
  16. )
  17. ;;pruebas
  18. (check-expect (chequear-diferencia 1 2) 'small )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement