
Language in Scheme e. (5 marks] Create a procedure (decreasing L) that returns a list of...
plz
in Scheme
b. [2 marks] Create a function (alternate listi list2) that creates a list by alternating elements from the two given input lists. E.g.: (alternate '(0 000) '(1 1 1 1 1 1)) + (010101 c. [2 marks] Create a procedure (count x L) that returns the number of instances of the value x in the list L. E.g.: (count 3 '(1 4 3 6 2 3 3 1 4 3 5 7)) + 4 (count 'b'(4 b...
In racket language, define a procedure named build-naturals that returns the list (list 0 .. (- n 1)) for any natural number n. Example: (build-naturals 5) returns (0 1 2 3 4).. The procedure must call build-list. The procedure passed to build-list must be a lambda expression, not a named procedure
this is assembly language for x-86 processors using microsoft visual studio Create a procedure named FindThrees that returns 1 if an array has three consecutive values of 3 somewhere in the array. Otherwise, return 0. The procedure’s input parameter list contains a pointer to the array and the array’s size. Use the PROC directive with a parameter list when declaring the procedure. Preserve all registers (except EAX) that are modified by the procedure. Write a test program that calls FindThrees...
In Scheme language Create a second function "vecfn" that allows one to pass the function to perform on the input lists as the first argument. Below are the test cases that should work when you type them in. (display (vecfn - '(1 2 3) '(4 5 6))) (newline) (display (vecfn + '(4) (list (sqrt -1)))) (newline) (display (vecfn / '(1 2 3) '(1 4 5))) (newline) Finally, add a "vecfun" to the syntax of Scheme. Submit a single text file.
2. Write a scheme function get-even-nums that accepts a list of numbers and returns a new list that contains only the even numbers. (Hint: use reminder function) Sample runs: (get-even-nums ‘(1 2 3 4 5 6 7 8 9)) should return (8 6 4 2). (get-even-nums ‘(1 3 5 7 9)) should return ’( ).
USING SCHEME PROGRAMMING LANGUAGE define a function addSubList that processes a list of lists of numbers and adds up all sub-lists. The output of your function is a flat list of numbers. (You can assume that your function only receives valid input). Example: (define Q '(1 2 (3 4) 1 5 (7 8))) ;;;;;;;;;;;;;;;;;;;;; ; (addSubList Q) ; => '(1 2 7 1 5 15) ;;;;;;;;;;;;;;;;;;;
this is the be anwsered in the language scheme and it only
Question 2 (100 marks in total) Write a recursive function (split L) that takes a list L, and returns a new list containing two sublists with the first sublist containing every second element in L and the second list containing the remaining elements not in the first sublist. Here are examples of how split should work: (split 12345678)) ((1 357) (24 68)) (split (cat bird dog horse mouse...
SCHEME :-) [5 marks] Write a procedure called convert that takes as arguments: a temperature value (number), and two strings representing the input and output units respectively. The procedure should support conversions to or from any combination of Celcius ("C"), Fahrenheit ("F"), and Kelvin ("K"). Any other unit argument should result in the return of an error string. A table of temperature conversion equations and a calculator for verification can be found here. (Note: to compare strings in Scheme you...
In scheme coding language Write a function filterN that returns only the numbers n through m from a lat. For example: (filterN 4 6 (1 turkey 5 9 4 bacon 6 cheese)) returns (5 4 6). Use only functions add1, sub1, and, or, <, >, null?, number?, zero?, define, lambda, cond, and else in the code. Assume n < m
SCHEME [3 marks] Define a procedure called days_in_month that takes as arguments two numbers representing a month and a year. The procedure should return the number of days in the given month. Note: the procedure should account for leap years. You may assume valid month and year values are passed in as arguments. E.g. (days_in_month 9 2019) → 30 E.g. (days_in_month 2 2019) → 28 E.g. (days_in_month 2 2020) → 29