Question: NOTE: Do NOT use a form of a for loop anywhere, including iterators. This is meant to be a functional exercise, so your code is
NOTE: Do NOT use a form of a for loop anywhere, including iterators. This is meant to be
a functional exercise, so your code is expected to not have side effects.
Instructions:
points Start with an array called inputtable. The array should have numbers between
and
points Use inputtable from step to create the following:
a Set of multiples of between and Name it fiveTable, print the contents to the console
b Set of multiples of between and Name it thirteenTable, print the contents to the console
c Set of squares of the numbers in inputtable. Name it squaresTable, print the contents to the console
points Get and then print the odd multiples of between and
points Get and then print the sum of even multiples of between and
Example: find the multiples and then sum them:
points Use currying to rewrite the function below:
function cylindervolumer h
var volume r r h;
return volume;
a Use r and h to call your curried function.
b Reuse the function from part a but use h
c Reuse the function from part a but use h
points Use the following code insert it into your code to take advantage of closures to wrap content with
HTML tags, specifically show an HTML table consisting of a table row that has at least
one table cellelement You can use the console to output your results.
Note: you MUST call makeTag at least once but may NOT call it more than times.
makeTag functionbeginTag endTag
return functiontextcontent
return beginTag textcontent endTag;
Example output for # Note that the tag is optional. Please do not use this data, but
substitute your own values for the contents of the cells.
Firstname
Lastname
Age
Jill
Smith
Eve
Jackson
points Do the generic version of questions and meaning the target
multiple must not be hard coded; hint: we studied closures and currying. This means you
should be able to use the same code to handle multiple scenarios, for example: first odd
multiples of and then even multiples of still in the range to Your code
should allow the grader to combine a chosen multiple along with the choice of odd even
without modifying your code.
points Following instructions.
You are encouraged to use map filter reduce which are available in the JavaScript array datatype
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
