***************PLEASE GIVE ANSWERS IN RACKET PROGRAMMING
LANGUAGE ONLY******************
Write a recursive Racket function "update-if" that takes...
***************PLEASE GIVE ANSWERS IN RACKET PROGRAMMING
LANGUAGE ONLY******************
Write a recursive Racket function "update-if" that takes two
functions, f and g, and a list xs as parameters and evaluates to a
list. f will be a function that takes one parameter and evaluates
true or false. g will be a function that takes one parameter and
evaluates to some output. The result of update-if should be a list
of items such that if x is in xs and (f x)...
Write a Racket
function "combine" that takes two functions, f and g, as parameters
and evaluates...
Write a Racket
function "combine" that takes two functions, f and g, as parameters
and evaluates to a new function. Both f and g will be functions
that take one parameter and evaluate to some result. The returned
function should be the composition of the two functions with f
applied first and g applied to f's result.
For example (combine
add1 sub1) should evaluate to a function equivalent to (define (h
x) (sub1 (add1 x))). You will need to use...
Write a Racket function "combine" that takes two functions, f
and g, as parameters and evaluates...
Write a Racket function "combine" that takes two functions, f
and g, as parameters and evaluates to a new function. Both f and g
will be functions that take one parameter and evaluate to some
result. The returned function should be the composition of the two
functions with f applied first and g applied to f's result.
For example (combine add1 sub1) should evaluate to a function
equivalent to (define (h x) (sub1 (add1 x))). You will need to use...
write a recursive racket function "sum-alternate" that takes a
positive integer x as a parameter. The...
write a recursive racket function "sum-alternate" that takes a
positive integer x as a parameter. The function should return the
sum of all the integers x, x-2, x-4, x-6, etc. as long as the
numbers are positive. For example, [sum-alternate 5] should
evaluate to 5 + 3 + 1, and [sum-alternate 6] should evaluate to
6+4+2.
Using Dr-Racket, what is the purpose of the
number function?
(define (number n)
(local [(define (abstract...
Using Dr-Racket, what is the purpose of the
number function?
(define (number n)
(local [(define (abstract int)
(* int 11))] (build-list n abstract)))
A) Create a list of the first n multiples of 11 starting at
11.
B) Create a list of the first n multiples of 11 starting at
0.
C) Create a list of the first n multiples of 11 starting at
1.
D) Create a list of the first 11 multiples of n starting at
1.
E)...
Nested Loops
Problem 3
Write a function called makesentence() that has
three parameters: nouns, verbs, and...
Nested Loops
Problem 3
Write a function called makesentence() that has
three parameters: nouns, verbs, and
gerunds. Each parameter is a list of strings,
where nouns list has noun strings (such as
'homework'), verbs list has veb
strings (such as 'enjoy'), and
gerunds list has gerund strings (those
-ing words, such as
'studying'). The function will go through all
these lists in a systematic fashion to create a list of all
possible sentences that use all the noun, verb, and...
IN C++ AS SIMPLE AS POSSIBLE ______
Re-write the given function,
printSeriesSquareFifth, to
use a while loop...
IN C++ AS SIMPLE AS POSSIBLE ______
Re-write the given function,
printSeriesSquareFifth, to
use a while loop (instead of for).
• The function takes a single integer n as a
parameter
• The function prints a series between 1 and
that parameter, and also prints its result
• The result is calculated by summing the numbers between 1 and
n (inclusive). If a number is divisible by 5, its
square gets added to the result instead.
• The function does not...
In racket, implement a tail-recursive function
called sum-pairs that creates a new list by adding the...
In racket, implement a tail-recursive function
called sum-pairs that creates a new list by adding the elements of
an input list in pairs. That is the first element of the resulting
list is the sum of the first two elements of the input, the second
element of the resulting list is the sum of the 3rd and 4th
elements of the input, and so on. If there is an odd number of
elements, then the last element remains unchanged. As...
Using PHP:
Write a function that:
Given a numerical parameter in input, computes and prints all...
Using PHP:
Write a function that:
Given a numerical parameter in input, computes and prints all
the prime numbers up to that value.
Example:
If input parameter is 10, output is "2, 3, 5, 7"
If input parameter is 100, output is "2, 3, 5, 7, 11, 13, 17,
19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89,
97"
Write a "tester function" that:
Given a specific subset of inputs, tests the...