Question
This program should be written in DrRacket language. Write the function add-message. Its task is to create an image that represents a sequence of chat
This program should be written in DrRacket language.
Write the function add-message. Its task is to create an image that represents a sequence of chat messages.
The function consumes three items:
a string, which represents the name(s) of the sender of the latest message;
another string, which represents the latest message; and
an image, which represents what has been said so far and by whom.
The function produces an image that represents the complete history, that is, the history combined with the latest message.
There are no constraints on how you wish to represent messages in an image as long as it clearly expresses who said what.
Here is one possible usage scenario:
(define history-1 empty-image) |
(define history-2 (add-message "Matthias and Becca" "hello world" history-1)) |
(define history-3 (add-message "Ben and Alan" "hello, you guys" history-2)) |
(define history-4 (add-message "Leena and Nada" "good bye" history-3)) |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started