Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please, if you do not know the answer, don't comment Use JavaScript: (5 points) Start with an array called inputtable . The array should have

please, if you do not know the answer, don't comment

Use JavaScript:

  1. (5 points) Start with an array called inputtable. The array should have numbers between 1 and 10.

NOTE: Do NOT use a form of a for loop anywhere, including iterators. This is meant to be a functional exercise.

  1. (30 points) Use inputtable from step 1 to create the following: -
    1. Set of multiples of 5 between 1 and 51. Name it fiveTable
    2. Set of multiples of 13 between 1 and 131. Name it thirteenTable
    3. Set of squares of the numbers in inputtable. Name it squaresTable
  2. (10 points) Get the odd multiples of 5 between 1 and 100. 5, 15,
  3. (20 points) Get the sum of even multiples of 7 between 1 and 100.
    1. Example, find the multiples and then sum them: 14 + 28+
  4. (15 points) Use currying to rewrite the function below: -

function cylinder_volume(r, h){

var volume = 0.0;

volume = 3.14 * r * r * h;

return volume;

}

Use r = 5 and h = 10 to call your curried function.

  1. (15 points) Use the following 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 cell/element. You can use the console to output your results.

makeTag = function(beginTag, endTag){

return function(textcontent){

return beginTag +textcontent +endTag;

}

}

  1. (5 points) Following instructions
  2. (Extra credit) Do the generic version of questions 3 and 4, meaning the target multiple must not be hard coded first odd or even and then the number whose multiples (in range 1 to 100) you want.

Type or paste question here

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

assess the infl uence of national culture on the workplace

Answered: 1 week ago