Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;Autor: Joann Esteban Bedoya
- ;;Fecha: agosto 8 de 2020
- ;;Contrato: multiplicacion: numero, numero >> numero
- ;;proposito: suma b veces a
- (define (multiplicacion a b)( cond
- [(= b 1) a]
- [else (+ a (multiplicacion a (- b 1)) )]
- ))
- (check-expect (multiplicacion 4 5) 20)
- ;--------------------------------------------------------------------------
- ;;contrato: elevar: numero, numero >> numero
- ;;proposito: multiplica b veces a
- (define (elevar a b) (cond
- [(= b 0) 1]
- [else (* a (elevar a (- b 1)) )]
- ))
- (check-expect (elevar 2 5) 32)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement