CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 06:04:38 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=21791adc365dbfda34755d43395e61bc517622c275409172eeef68a7b30fccb2a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22L3BdZDkCS9SixzT9XWgPBYhPW31h8NOg%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cc29431cac4e3d-BLR
Ejercicio 25 de Enero - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;.
- (define-struct movie (title producer))
- (define-struct boyfriend (name hair eyes phone))
- (define-struct CD (artist title price))
- (define-struct sweater (material size producer))
- ;;Autor: Carlos A Delgado
- ;;Fecha: 25 de Enero de 2021
- ;;Contrato: cambiar-artista: simbolo, CD -> CD
- ;;Propósito: Esta función permite cambiar el campo artist de una estructura CD que se ingresa
- ;;Ejemplos
- ;;simbolo = 'Madonna CD = (make-CD 'Juanes 'Colombia-querida 5000) retorna: (make-CD 'Madonna 'Colombia-querida 5000)
- ;;simbolo = 'Shakira CD = (make-CD 'Arjona 'Mira-al-cielo 4000) retorna (make-CD 'Shakira 'Mira-al-cielo 4000)
- (define (cambiar-artista cd sim)
- (cond
- [(and (symbol? sim) (CD? cd))
- (make-CD
- sim
- (CD-title cd)
- (CD-price cd))]
- [else (error "La función debe recibir un símbolo y una estructura CD")]
- ))
- (define cdA (make-CD 'Juanes 'Colombia-querida 5000))
- (check-expect (cambiar-artista cdA 'Madonna)
- (make-CD 'Madonna 'Colombia-querida 5000))
- (check-expect (cambiar-artista (make-CD 'Arjona 'Mira-al-cielo 4000) 'Shakira)
- (make-CD 'Shakira 'Mira-al-cielo 4000))
- (check-error (cambiar-artista (make-CD 'Arjona 'Mira-al-cielo 4000) "Aterciopelados"))
- (check-error (cambiar-artista "Juanes" "Aterciopelados"))
- ;;Autor: Carlos A Delgado
- ;;Fecha: 25 de Enero de 2021
- ;;Contrato: mejor-sweater: sweater, sweater -> sweater
- ;;Descripción: Esta función permite saber cual tiene más tamaño (size) de dos estructuras sweater que ingresan
- ;;Ejemplos
- ;; sweaterA: (make-sweater 'Cuero 100 'HBO) sweaterB: (make-sweater 'Lana 200 'TNT)
- ;; Retorno: (make-sweater 'Lana 200 'TNT)
- (define (mejor-sweater sweaterA sweaterB)
- (cond
- [(and (sweater? sweaterA) (sweater? sweaterB))
- (cond
- [(> (sweater-size sweaterA)
- (sweater-size sweaterB))
- sweaterA]
- [else sweaterB])]
- [else (error "Deben ingresar dos estructuras sweater")]
- ))
- (check-expect (mejor-sweater (make-sweater 'Cuero 100 'HBO) (make-sweater 'Lana 200 'TNT)) (make-sweater 'Lana 200 'TNT))
- (check-error (mejor-sweater (make-CD 'Arjona 'Mira-al-cielo 4000) (make-sweater 'Lana 200 'TNT)))
Advertisement
Add Comment
Please, Sign In to add comment
-
✅ Make $2500 in 20 minutes⭐⭐⭐ H
JavaScript | 4 sec ago | 0.24 KB
-
⭐⭐⭐Free Giftcards Method⭐⭐
Java | 4 sec ago | 0.10 KB
-
⭐✅ Trading Profit Method ✅ NEVER SEEN BEFORE...
JavaScript | 6 sec ago | 0.24 KB
-
⭐⭐Exchange Exploit⭐⭐ M
JavaScript | 15 sec ago | 0.24 KB
-
⭐ Instant BTC Profit Method ✅ NEVER SEEN BEFO...
JavaScript | 15 sec ago | 0.24 KB
-
⭐⭐⭐ChangeNOW Exploit⭐⭐
Java | 16 sec ago | 0.10 KB
-
⭐✅ MAKE $2000 INSTANTLY ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 24 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ⭐⭐ 4
JavaScript | 26 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand