Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me with this LISP assignment, #3 and #4 please LISP Programming Assignment It is a good idea to start this assignment early;

Can someone help me with this LISP assignment, #3 and #4 please

image text in transcribedimage text in transcribed

LISP Programming Assignment It is a good idea to start this assignment early; Lisp programming, while not inherently difficult, often seem somewhat foreign at first, particularly when it comes to recursion and list manipulation. This assignment is loosely based on material by Dr. Henri Casanova. Make sure you have extensive comments! Problem #1 Define a function that takes two arguments and returns the greater of the two. Problem #2 Write a function called inches that accepts feet and inches and returns the equivalent length in centimeters. If x is the first argument and y is the second, the formula is 2.54(12x +y). For example, USER (1)inches 0 1) 2.54 USER (1)inches 6 2.5) 189.22999999999999 Problem #3-Remove an element from a list using iteration Write a Common Lisp function called my-remove that takes an atom and a list in input, and returnsa list that is identical to the input list, but with elements equal to the input atom removed, if any. Examples of the function in operation are shown below (user input is in red): CL-USER (1): (my-remove b '(a bc b d)) (a c d) CL-USER (2): (my-remove 'b '(a cd e f)) (a cde f) CL-USER (3): (my-remove'a '(b (a d) a d)) (b (a d) d) CL-USER (4): (my-remove 'a' nil Problem #4-Remove an element from a list using Recursion LISP Programming Assignment It is a good idea to start this assignment early; Lisp programming, while not inherently difficult, often seem somewhat foreign at first, particularly when it comes to recursion and list manipulation. This assignment is loosely based on material by Dr. Henri Casanova. Make sure you have extensive comments! Problem #1 Define a function that takes two arguments and returns the greater of the two. Problem #2 Write a function called inches that accepts feet and inches and returns the equivalent length in centimeters. If x is the first argument and y is the second, the formula is 2.54(12x +y). For example, USER (1)inches 0 1) 2.54 USER (1)inches 6 2.5) 189.22999999999999 Problem #3-Remove an element from a list using iteration Write a Common Lisp function called my-remove that takes an atom and a list in input, and returnsa list that is identical to the input list, but with elements equal to the input atom removed, if any. Examples of the function in operation are shown below (user input is in red): CL-USER (1): (my-remove b '(a bc b d)) (a c d) CL-USER (2): (my-remove 'b '(a cd e f)) (a cde f) CL-USER (3): (my-remove'a '(b (a d) a d)) (b (a d) d) CL-USER (4): (my-remove 'a' nil Problem #4-Remove an element from a list using Recursion

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

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

Understand the role of corporate design in communications.

Answered: 1 week ago