4-Write a Scheme procedure that takes a list and returns the sum of the odd- numbers that are less than 8 in the list. For example, (sumodd '(1 (2 () 6) 3 (5) 8)) returns 9. Then, Manually trace your procedure with the provided example. Please study provided examples foreign the lecture notes to learn how you should manually trace our procedure.
Q: Multiple choice (a) Vending machine is accepting a regular set as input. (b) Vending machine is…
A: Almost all real word programs are used context free set. It gives the syntax of the c++ language. It…
Q: Write a Scheme function that returns the union of two simple list parameters that represent sets.
A: Scheme function The function scheme is written in teh arguments where the first element in the list…
Q: Write a Scheme function (count e Ist) that counts the number of times the eleme Occurs in the list…
A: The complete below is solved using scheme programming language:.
Q: Write the standard quicksort algorithm in Scheme, without using any imperative language features. Be…
A: Write the standard quicksort algorithm in Scheme, without using any imperative language features. Be…
Q: 4-Write a Scheme procedure that takes a list and returns the sum of the number that are greater than…
A: Check the scheme procedure below.
Q: Write a Scheme function (count e Ist) that counts the number of times the element e occurs in the…
A: Schema procedures are first-class objects in the language; you refer to a procedure the same way you…
Q: In Scheme please. Please do not copy and paste the wrong answer that is out there. Dislike will be…
A: Solution: (define (clean-list lst) (cond ((null? lst) '()) ((not (number? (car lst))) (clean-list…
Q: 4-Write a Scheme procedure that takes a list and returns the sum of the number that are less than 6…
A: Program Plan: Define sumeven() procedure that add the numbers less than 6. Finally, print the…
Q: Transform the following grammar into EBNF: → begin end → | ; → =…
A: Solution :: Let's see first what is EBNF called ? Answer :: The EBNF is a way to specify a formal…
Q: Write a Scheme function mycount mylist myvar that counts the number of times myvar appears in the…
A: Please refer below code and output: Language used is python: def mycountmylist(lst,myvar): c=0…
Q: Consider the following Scheme function: (define (mystery input-list) (cond ((null? input-list) 0)…
A: The function has a conditional expression using input list and null. The cdr function will take a…
Q: Write a Scheme procedure that takes a list and returns the list created by switching successive…
A: (define (newlist inputList) (cond ; Conditional statement ( (null? inputList)…
Q: 10-Define a scheme procedure that takes a set (a list of distinct elements) and generates a list of…
A: Check code below.
Q: 6-Write a Scheme procedure that takes a list and returns the list created by switching successive…
A: Please check the step 2 for code with comment for better understanding and step 3 for screenshot of…
Q: Which one of the following is the equivalent righ recursive grammar?
A: Solution - In the given question ,we have to convert the given grammer into equivalent right…
Q: EX1: The language L of strings that does not start with (b,c) defined over £={a,b,c}. EX2: 1- The…
A: regular language to the above questions is in step 2.
Q: The language L of strings that start with bba and end with abc, defined over Σ={a,b,c}, what will be…
A: Answer:
Q: Question 5: what is suffix trie in data structure? How do you show the suffix trie T for eight…
A: Suffix Tries • A suffix trie is a compressed trie for all the suffixes of a text Compact…
Q: 2. Write a SCHEME function named (tree-depth T) which takes a tree node, T, as a parameter and…
A: Solution: Given T as tree and we have to find depth of the tree so we have written function. The…
Q: Topic: Concepts of programming Language 5. a) What is the primary difference between a record and a…
A: Primary Difference between a record and a tuple: Records: 1. Records are similar to…
Q: Write a Racket/Scheme function that given a number x, the function returns a list of numbers from n…
A: The coding implementation is implemented below: Here in this code I am providing detailed…
Q: 1. Write a SCHEME function, named (tree-size T), which takes a tree node, T, and returns the size…
A: According to our guidelines we are supposed to answer only on question. Kindly repost other…
Q: 5-Write a Scheme procedure that takes a list and returns a list identical to the parameter except…
A: Logic is to get the 1st elem from the list, then the 2nd one and then the rest of the list starting…
Q: 3) Given the grammar below, (a) list all the terminals and (b) list all the non-terminals. ASSIGN -…
A: Please upvote me please. I need it badly. I am providing you the correct answer below. Terminals…
Q: The following grammar determined if the statement is set or a list. Write a simple parser to execute…
A: A context-free grammar is a popular notation for expressing a language's syntax: Backus-Naur Form,…
Q: Write a full C language programming by using struct structure to store data in mvAmigo linked-list…
A: CODE #include<stdio.h>#define SIZE 10#include<stdlib.h> struct node{ int weight; char…
Q: Represent the reversed web link graph in a similar way. For example, [a, b, c] means that {b, c} is…
A: Please see the code in step 2. As no language is mentioned, I've done it in Python. However, idea…
Q: Select the lines of code in the right order to create a Scheme function that generates a list of X…
A: Answer is ( Y X) (lambda (Y X) (lambda Y X)
Q: Define a function in SCHEME called replaceInList that takes three parameters: a list of integers:t…
A: def replaceInList(t,x,y): if y in t: #replacing the y element in the list with x…
Q: your program in either C or Java. The Problem Given a grammar in Chomsky Normal Form and several…
A: Java programs can be asked from control statements, array, string, oops etc. Java basic programs…
Q: Code in Prolog. Do not use in built libraries. Implement the following relation to find the maximum…
A: Input : The list of values. Output : Maximum value from the list.
Q: Write a Scheme function which returns a list without the last element: (rdc '((1 2 3) 4 (5 6))) ((1…
A: Scheme is a computer language with several paradigms. It's a Lisp dialect that allows for both…
Q: Evaluate the following Scheme form: (let ((a 3) (b 4) (+ (* a a) (* 2 a b) (* b b))
A: Given: Evaluating scheme expressions: (let((a 3)(b 4)) (+(* aa)(*2 ab)(* bb)))
Q: your program in either C or Java. The Problem Given a grammar in Chomsky Normal Form and several…
A: Java programs can be asked from control statements, array, string, oops etc. Java basic programs…
Q: Q5: Compose Write the procedure composed, whlch takes In procedures f and g and outputs a new…
A: Using function composition (Combining two or more function in a way that result of one function will…
Q: List Construction Write Scheme programs that generate the following lists as output using only cons…
A: The Answer is
Q: Write a Scheme function which returns a new list which an element e is added at the end of the list:…
A: In this program we have to Implement the scheme program function which will take a new element and a…
Q: Write a Scheme program that returns the maximum of a list of numbers formed from the union of the…
A: According to the information given:- We have to join two list and return total number of element in…
Q: In computer science, Backus-Naur form or Backus normal form (BNF) is a meta syntax notation for…
A: From the above given program, we get the variables n,r, sum=0, temp So CFG will be n-> temp…
Q: I need the answer as soon as possible
A: one of obj1 and obj2 is an exact number but the other is an inexact number.obj1 and obj2 are numbers…
Q: Q1) Four function calculator ( addition, subtraction, multiplication, division) of a single…
A: Q1) Four function calculator ( addition, subtraction, multiplication, division) of a single…
Q: 8-Define a scheme procedure that returns the total number of leaves of a tree For example,…
A: (define (count-leaves t) (cond ((null? t) 0) ((not (pair? t)) 1) (else (+…
Q: Write a Scheme procedure that sums all the elements in a given list of numbers.
A: Scheme program: Scheme was designed by Guy L.Steele and Gerald Jay Sussman in 1970. Scheme is a high…
Q: 9-Define a scheme procedure that takes a list and returns the depth of the most nested parentheses…
A: The answer is given below:
Q: Answer the below questions in ML Editor, ONLY ML please. Write a function isL3 to test if the length…
A: Code : def isL3(list): if(len(list)%3==0): return "True" else: return…
Q: Write a Scheme program using Dr. Racket to perform a binary search. Sample Data Pattern:
A: You have to use code like this (define emptyTree '()) (define (addToTree Tree k v) (match Tree ['()…
Q: count a number of 1's in an orbitrary list of numbers . In a scheme language, please
A: Define an arbitrary list L with numbers. Run the loop through the list. Check if the number is 1,…
Q: Write a scheme function that require user to input a character. Check whether the character is equal…
A: The question is to write a scheme function that require user to input a character. Check whether the…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- Computer Science Please do not copy from another post. Write a Racket/Scheme function that given a number x, the function returns a list of numbers from n to x. Note that you need to return a list and not print the numbers inside the function. For example: (fun 7) should returns list ( 765 43 21 0). You are limited to the following functions: cons, append, list, comparison predicates (such as =, equal, ...), define, cond, if, else.please don't just copy other's work. thanks. -Write a Scheme procedure that takes a list and returns the list created byswitching successive elements in the list. For example (newlist ‘(a (b c ) (d) e f g))returns ( (c b) a e (d) g f ) .Then, Manually trace your procedure with the provided example.Write a function removeN which takes three arguments called N, E and L (where L is a list) and returns a list equal to L but with the first N occurrences of E in that list removed. Note: only first N occurrences of E must be removed, not all occurrences! If there are less than N occurrences of E in the list, then all occurrences of E should be removed. Using scheme language Test Result (removeN 2 'a '(a b a c a d a)) (b c a d a) (removeN 4 'a '(a b a c a d a)) (b c d)
- Can someone pls explain to me ASAP??!!! Write a Scheme function named elements which counts the number of elements in a list; for example: (elements '(1 (2 (3) 4) 5 6)) is 6, while the length of the same list is 4.Use C language only. Create a program that will ask for Enter number of students: (for this example 2) Enter student 1's name: Enter student 1's age: Enter student 2's name: E nter student 2's age: At the end, the program shall display two class lists: one with arranged name (ascending order) and the other one arranged according to their age (ascending order). The two lists should contain the complete details of the students as follows: Sorted by name: 1. name, age 2. name, age Sorted by age: 1. name, age 2. name, age If the number of students is less than one, the program will display "no students to display." The letter case (uppercase or lowercase) shall have no bearing in the arrangement of names. Please use the "fgets()" in getting the name.Write a function named second-largest in Scheme that takes a list of numbers and uses fold (or reduce) to return the second largest element on the list. You must use either fold or reduce to do the vast majority of th work. (You may do a little pre- and post-processing outside the call to fold.) You may use the built-in fold method by adding the line (require 'list-lib), or you can use your own implementation. The built-in fold function has parameters in this order: action partial-result lst. You may assume that the list contains at least one element. For example, • (second-largest '(5)) should return 5 • (second-largest '(1 3)) should return 1 • (second-largest '(8 6 7 5 3 0 9)) should return 8
- Write a function using scheme language, that takes in a list of values as input and returns true if list contains two equal values otherwise return false.For example: If the list (1 5 1 5) should print #t If the list (4 2 3 6) should print #f Note: You can not use any built-in function and use pure scheme language also use recursion to acheive this.Write a function using scheme language, that takes in a list of values as input and returns true if list contains two equal values otherwise return false.For example: If the list (1 5 1 5) should print #t If the list (4 2 3 6) should print #f Note: You can not use any built-in function and use pure scheme language also use recursion to acheive this. The soultion should be runnable in Dr. Racket IDE. Please don't give solution in any other language it should be Scheme language only.Write a function using scheme language, that takes in a list of values as input and returns true if list contains two equal values otherwise return false.For example: If the list (1 5 1 5) should print #t If the list (4 2 3 6) should print #f Note: You can not use any built-in function and use pure scheme language also use recursion to acheive this. The soultion should be runnable in Dr. Racket IDE. Please don't give solution in any other language it should be Scheme language only. My solution which works only half if you please enhance and correct it: (define duplicateCheck (lambda (testList) (cond ((null? testList) #f) ( (eq? (car testList) (car (cdr testList) ))#t) (not(eq? (car testList) (car (cdr testList) ))#f) (else (duplicateCheck (cdr testList))))))
- Using the Scheme dialect of Lisp, write a single function that squares each item of a list, then sums all the items in the list, and then lastly, takes square root of the sun.Write in C sharp programming We are given a string containing a list of forbidden words and a text containing some of these words. Write a program that replaces the forbidden words with asterisks. Example: Words: "PHP, CLR, Microsoft" The expected result: Microsoft announced its next generation PHP compiler today. It is based on .NET Framework 4.0 and is implemented as a dynamic language in CLR. ********* announced its next generation *** compiler today. It is based on .NET Framework 4.0 an3. A palindrome is a sentence that contains the same sequence of letters read-ing it either forwards or backwards. A classic example is "Able was I, ere I saw Elba." Write a recursive function that detects whether a string is a palindrome. The basic idea is to check that the first and last letters of the string are the same letter; if they are, then the entire string is a palindrome if everything between those letters is a palindrome. There are a couple of special cases to check for. If either the first or last character of the string is not a letter, you can check to see if the rest of the string is a palindrome with that character removed. Also, when you compare letters, make sure that you do it in a case-insensitive way. Use your function in a program that prompts a user for a phrase and then tells whether or not it is a palindrome. Here's another classic for testing: "A man, a plan, a canal, Panama!"