Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Do this in DrRacket program. Create a list of symbols to be a sentence such as (

ID: 3588595 • Letter: D

Question

Do this in DrRacket program. Create a list of symbols to be a sentence such as (the boy threw the red apple). Create another list to be a translation dictionary list - ((red rouge) (green verde) (boy gaston) (apple pomme)(pen plumb) (shoe sabot)) where the first item in the embedded list is English and the second is French (or as best I can remember or some other language). When you run the function (translate sentence dictionary) it will produce (the gaston threw the rouge pomme). You should add more words or even other languages to translate into. Also, make up more sentences with other words to match.

(define french '((red rouge)(green vert) (boy gaston) (apple pomme)))

(define german '((red rot)(green grun)(boy junge)(apple apfel)))

(define sentence '(the boy threw the red apple))

Explanation / Answer

(define french '((the la)(kicked coupe)(ball)(ballon)(like comme)(pumpkin citroville)(pie tarte)(I je)(girl fille)(bought achete)(some certains)(flowers fleurs)(cooked cuit)(dinner diner)(today aujourdhui))

define german '((boy junge)(the das)(kicked getreten)(ball ball)(i ich)(like mogen)(pumpkin kurbis)(pie kuchen)(girl madchen)(bought gekauft)(some etwas)(flowers blumen)(cooked gekocht)(dinner abendessen)(today heute))

define spanish '((boy chico)(the el)(kicked golpeado)(ball pelota)(like gusta)(i yo)(pumpkin calabaya)(pie tarta)(girl nina)(bought compro)(some algunos)(flowers flores)(cooked cocindo)(dinner cena)(today hoy))

(define sen '(the boy kicked the ball))

The list function is used to hold any number of values and returns a list. In the above example

(define li (list (the boy kicked the ball))

>list (I like pumpkin pie)

>list (the girl bought some flowers)

>list(i cooked dinner today)

and for creating dictionary list

(define (map li sen)

(if (null? sen)

'()

(cons (+1 car sen))

(list cdr sen))))

In the above code the the syntax the 'li' represents the list name and 'cdr' is used to return the second value of the functions in german, spanish and french.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote