Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2)
- (define (dieta x) (cond [(> (image-height x) (image-width x)) "Flaca"]
- [(= (image-height x) (image-width x)) "Cuadrada"]
- [(< (image-height x) (image-width x)) "Gorda"]) )
- -----
- (define (triang a b c) (cond [(not (= (+ a b c) 180)) "Error en los angulos"]
- [(= a b c) "Equilatero"]
- [(or (= a b) (= a c) (= b c)) "Isosceles"]
- [#true "Escaleno"]) )
- -----
- (define PC 18)
- (define PL 2)
- (define (precio c l) (cond [(>= (+ c l) 10) (* 0.82 (+ (* l PL) (* c PC)) )]
- [(and (>= l 5) (>= c 4)) (+ (* l PL 0.85) (* c PC 0.9))]
- [(>= l 5) (+ (* l PL 0.85) (* c PC))]
- [(>= c 4) (+ (* l PL) (* c PC 0.9))]
- [#true (+ (* l PL) (* c PC))] ) )
- -----
- (define (terna a b c) (cond [(= (expt a 2) (+ (expt b 2) (expt c 2) ) ) "A es hipotenusa"]
- [(= (expt b 2) (+ (expt a 2) (expt c 2) ) ) "B es hipotenusa"]
- [(= (expt c 2) (+ (expt a 2) (expt b 2) ) ) "C es hipotenusa"]
- [#true "No es una terna pitagorica"] ) )
- -----
- 4)
- (define (dieta x) (cond [(> (image-height x) (* 2 (image-width x))) "Muy flaca"]
- [(> (image-height x) (image-width x)) "Flaca"]
- [(= (image-height x) (image-width x)) "Cuadrada"]
- [(< (* 2 (image-height x)) (image-width x)) "Muy gorda"]
- [(< (image-height x) (image-width x)) "Gorda"]
- ) )
- -----
- 5)
- (define (clasificar t) (cond [(< t 0) "Helado"]
- [(< t 15) "Frío"]
- [(< t 25) "Templado"]
- [#true "Caluroso"]))
- -----
- 6-9)
- (define (sgn3 x) (cond [(number? x) (sgn2 x)]
- [(string? x) (if (boolean? (string->number x)) "La cadena no se puede convertir a un número" (sgn2 (string->number x)) )]
- [(boolean? x) (sgn2 (if x 1 0))]
- [(image? x) (sgn2 (- (image-width x) (image-height x) ) )]
- [#true "Clase no soportada por la funcion"]
- ))
- -----
- 10)
- (define (f x) 42)
Add Comment
Please, Sign In to add comment