Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago