From 41b23a6a65ba52d3d970098ce34679f2c3d3b263 Mon Sep 17 00:00:00 2001 From: Marcelo dos Santos Date: Wed, 23 Jan 2019 20:08:56 -0200 Subject: [PATCH] Yell implementado. --- racket/HtC1x/1b/yell.rkt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 racket/HtC1x/1b/yell.rkt diff --git a/racket/HtC1x/1b/yell.rkt b/racket/HtC1x/1b/yell.rkt new file mode 100644 index 0000000..79567fe --- /dev/null +++ b/racket/HtC1x/1b/yell.rkt @@ -0,0 +1,28 @@ +;; The first three lines of this file were inserted by DrRacket. They record metadata +;; about the language level of this file in a form that our tools can easily process. +#reader(lib "htdp-beginner-reader.ss" "lang")((modname yell) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f))) +;; yell.rkt + + +;; +;; PROBLEM: +;; +;; DESIGN a function called yell that consumes strings like "hello" +;; and adds "!" to produce strings like "hello!". +;; +;; Remember, when we say DESIGN, we mean follow the recipe. +;; +;; Leave behind commented out versions of the stub and template. + +;; String -> String +;; Produce string with "!" added to end of supplied string +(check-expect (yell "hello") "hello!") +(check-expect (yell "bye") "bye!") + +;(define (yell s) "") ; stub + +;(define (yell s) ; template +; (... s)) + +(define (yell s) + (string-append s "!"))