Create and run the following functions in the debug window


This is using Allegro CL (LISP)

1. Start Allegro CL
In the Debug Window you will see the following prompt:
CG-USER(1):

2. Enter the following text: (defun hello () (write-string "Hello, Everyone!"))
You should then see the following:
HELLO
CL-USER(2):

3. Run your function by entering: (hello)
Hopefully you will see the following in the window:
Hello, Everyone!
"Hello, Everyone!"
CL-USER(3):

4. Create and run the following functions in the Debug Window. Do not close the Debug Window yet.

a. goodbye: It should print "bye", "good bye", "farewell" or some other word.

b. middle-name: Accepts a full name as an argument and returns the middle name. This name can be represented as a list. For example, if you execute the program by entering "(middle-name ‘(Mary Jane Doe))" the output should be "Jane".

c. second-of-second: Accepts a list of lists as an argument and returns the second element of the second list. For example, if you run the function by entering (second-of-second ‘((a b c) (1 x) (e f))') the output should be "x".

d. repeater: letting the user specify the number of times to print the text in an argument. Suppose you create the function to print the text "AI"

If the function accepts arguments one should be able to execute it by entering (repeater x), where x is an integer. Entering (repeater 4) should produce this output:
AI
AI
AI
AI
e. adder: Prompts the user to enter 4 numbers and print the sum to the console. To run this function, one should only have to enter (adder).

Solution Preview :

Prepared by a verified Expert
Programming Languages: Create and run the following functions in the debug window
Reference No:- TGS01563971

Now Priced at $30 (50% Discount)

Recommended (99%)

Rated (4.3/5)