Question

Write a program using DrRacket is a member of a list (member 1 '(2 3 4...

Write a program using DrRacket

is a member of a list

(member 1 '(2 3 4 1 5)) => true

(member 1 '(2 3 4 (1) 5)) => false

Homework Answers

Answer #1

(print (if(member 1 (list 2 3 4 1 5)) 'true 'false))
(print (if(member 1 (list 2 3 4 (list 1) 5)) 'true 'false))

(list 2 3 4 1 5) and (list 2 3 4 (list 1) 5) creates the lists as  '(2 3 4 1 5) and  '(2 3 4 (1) 5)

member 1 (list 2 3 4 1 5)) and (member 1 (list 2 3 4 (list 1) 5)) determines if 1 is member if lists or not.

1 is member of list   '(2 3 4 1 5)

1 is not a member of list '(2 3 4 (1) 5)

Using if true and false are evaluated

(if(member 1 (list 2 3 4 1 5)) 'true 'false))

(if(member 1 (list 2 3 4 (list 1) 5)) 'true 'false))

Output

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a program using DrRacket: is a member of a list. (Can you explain everything) code...
Write a program using DrRacket: is a member of a list. (Can you explain everything) code must be designed from the scratches no library functions (member 1 '(2 3 4 1 5)) => true (member 1 '(2 3 4 (1) 5)) => false
using C++ 1) write a program to calculate to avg of N number of subjects. 2)write...
using C++ 1) write a program to calculate to avg of N number of subjects. 2)write a program to find the factorial of 5! 5*4*3*2*1 3)write a program to display the multiplication table for any number please enter number : 3 1*3=3 2*3=6 2*4= 10*3=30 4) find the factorial on n
Program in Java 1- Write a code to remove continuous repeatitive elements of a Linked List....
Program in Java 1- Write a code to remove continuous repeatitive elements of a Linked List. Example: Given: -10 -> 3 -> 3 -> 3 -> 5 -> 6 -> 6 -> 3 -> 2 -> 2 -> NULL The answer: -10 -> 3 -> 5 -> 6 -> 3 -> 2 -> NULL
program in java 1- Write a code to remove continuous repeatitive elements of a Linked List....
program in java 1- Write a code to remove continuous repeatitive elements of a Linked List. Example: Given: -10 -> 3 -> 3 -> 3 -> 5 -> 6 -> 6 -> 3 -> 2 -> 2 -> NULL The answer: -10 -> 3 -> 5 -> 6 -> 3 -> 2 -> NULL
Program in Java 1- Write a code to remove continuous repeatitive elements of a Linked List....
Program in Java 1- Write a code to remove continuous repeatitive elements of a Linked List. Example: Given: -10 -> 3 -> 3 -> 3 -> 5 -> 6 -> 6 -> 3 -> 2 -> 2 -> NULL The answer: -10 -> 3 -> 5 -> 6 -> 3 -> 2 -> NULL
4) Write a Java program using Conditions: Write a program where it will ask user to...
4) Write a Java program using Conditions: Write a program where it will ask user to enter a number and after that it will give you answer how many digits that number has. Steps: 1) Create Scanner object and prompt user to enter the number and declare variable integer for input 2) Use if else condition with && condition where you will specify the digits of numbers by writing yourself the digit number that should display: Example(num<100 && num>=1), and...
Write a Java program using the OOP paradigm to do the following: 1. Main Function: create...
Write a Java program using the OOP paradigm to do the following: 1. Main Function: create a list with a million items, and you can use the generate function to add a million random values to the list. 2. Create a method to sort the list created in the main function using bubble sort, then use the sorted list to search for the (k) value using binary search. 3. Create a method to create a new list of 1000 items...
In DrRacket, is there any way I can change (list 1 (list 2 (list 3 4...
In DrRacket, is there any way I can change (list 1 (list 2 (list 3 4 5) 6 )7) to (list 1 2 3 4 5 6 7)?
1.Write a c++ program to find Maximum out of two numbers using friend function. Here one...
1.Write a c++ program to find Maximum out of two numbers using friend function. Here one member is of one class and second belongs to another class. 2.Write a c++ program to swap the values of private data members of classes names classOne and classTwo using friend keyword.
write code using python or repl.it 1. List 4 attributes that you'd create for class "student"....
write code using python or repl.it 1. List 4 attributes that you'd create for class "student". 2. List 2 setters and 2 getters for class student including their parameters 3. Write the complete definition for class student including attributes and methods created above using the correct Python syntax. 4. Create one object of class student and print the values of all its attributes. You can either call the getter method or access the attribute directly using the dot notation.