{ "key_pair_value_system": true, "answer_rating_count": "", "question_feedback_html": { "html_star": "", "html_star_feedback": "" }, "answer_average_rating_value": "", "answer_date_js": "2024-09-02T04:24:14-04:00", "answer_date": "2024-09-02 04:24:14", "is_docs_available": null, "is_excel_available": null, "is_pdf_available": null, "count_file_available": 0, "main_page": "student_question_view", "question_id": "8896438", "url": "\/study-help\/questions\/write-a-defining-table-and-a-function-to-multiply-each-8896438", "question_creation_date_js": "2024-09-02T04:24:14-04:00", "question_creation_date": "Sep 02, 2024 04:24 AM", "meta_title": "[Solved] Write a defining table and a function to | SolutionInn", "meta_description": "Answer of - Write a defining table and a function to multiply each element in an array by some value. The function must have this | SolutionInn", "meta_keywords": "write,defining,table,function,multiply,element,array,value,header,list,multiplier,called", "question_title_h1": "Write a defining table and a function to multiply each element in an array by some value. The function must have this header: function multiply(list,", "question_title": "Write a defining table and a function to multiply each element in", "question_title_for_js_snippet": "Write a defining table and a function to multiply each element in an array by some value The function must have this header function multiply(list, multiplier) If the multiply function were called like this var list 17, 8, 9, 5, 20 var products multiply(list, 3) The multiply function would return an array with these values 51, 24, 27, 15, 60 Test Function With This Code Count Evens and Multiply With Arrays Defining Table Here function doCalcs() var testarray 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 var evenscount countEvens(testarray) This should be 5 var multipliedarray multiply(testarray, 10) This should be an array containing 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 document getElementById( output ) innerHTML evenscount evenscount document getElementById( output ) innerHTML multiplyarray for (var i 0 i multipliedarray length i ) document getElementById( output ) innerHTML multipliedarray i if (i multipliedarray length 1) document getElementById( output ) innerHTML , document getElementById( output ) innerHTML function countEvens(list) Your code here function multiply(list, multiplier) Your code here Execute Functions", "question_description": "

Write a defining table and a function to multiply each element in an array by some value. The function must have this header:<\/p>

function multiply(list, multiplier) <\/pre> 

If the multiply function were called like this:<\/p>

var list = [ 17, 8, 9, 5, 20 ];var products = multiply(list, 3); <\/pre> 

The multiply function would return an array with these values: [ 51, 24, 27, 15, 60 ]<\/p>

Test Function With This Code:<\/strong><\/p>

<\/p>

<\/p>

<\/p>

<\/p>

Count Evens and Multiply With Arrays<\/title><\/p> <p> <script type=\"text\/javascript\"><\/p> <p> \/*<\/p> <p> Defining Table Here<\/p> <p> *\/<\/p> <p> function doCalcs()<\/p> <p> {<\/p> <p> var testarray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];<\/p> <p> var evenscount = countEvens(testarray); \/\/This should be 5<\/p> <p> var multipliedarray = multiply(testarray, 10); \/\/This should be an array containing 10, 20, 30, 40, 50, 60, 70, 80, 90, 100<\/p> <p> document.getElementById(\"output\").innerHTML = \"evenscount = \" + evenscount + \" \";<\/p> <p> document.getElementById(\"output\").innerHTML += \"multiplyarray = [\";<\/p> <p> for (var i = 0; i < multipliedarray.length; i++)<\/p> <p> {<\/p> <p> document.getElementById(\"output\").innerHTML += multipliedarray[i];<\/p> <p> if (i != multipliedarray.length-1)<\/p> <p> {<\/p> <p> document.getElementById(\"output\").innerHTML += \", \";<\/p> <p> }<\/p> <p> }<\/p> <p> document.getElementById(\"output\").innerHTML += \"] \";<\/p> <p> }<\/p> <p> function countEvens(list)<\/p> <p> {<\/p> <p> \/\/ Your code here<\/p> <p> }<\/p> <p> function multiply(list, multiplier)<\/p> <p> {<\/p> <p> \/\/ Your code here<\/p> <p> }<\/p> <p> <\/script><\/p> <p><\/head><\/p> <p><body><\/p> <p> <button type=\"button\" onclick=\"doCalcs()\">Execute Functions<\/button><\/p> <p> <div id=\"output\"><\/div><\/p> <p><\/body><\/p> <p><\/html><\/p>", "transcribed_text": "", "related_book": { "title": null, "isbn": null, "edition": null, "authors": null, "cover_image": null, "uri": null, "see_more_uri": "" }, "free_related_book": { "isbn": "", "uri": "", "name": "", "edition": "" }, "question_posted": "2024-09-02 04:24:14", "see_more_questions_link": "\/study-help\/questions\/computer-science-operating-system-2022-August-09", "step_by_step_answer": "The Answer is in the image, click to view ...", "students_also_viewed": [ { "url": "\/study-help\/accounting-for-investments\/abc-fund-had-the-following-trades-in-andhra-bank-in-1989375", "description": "ABC Fund had the following trades in Andhra Bank in the options market through Silver Man brokers. The stock exchange requires that the writer of the options maintain 10 percent of the value of the...", "stars": 0 }, { "url": "\/journal-entries-for-the-allowance-method-data-related-to-sales", "description": "Journal entries for the allowance method. Data related to sales on accounts of Health Company for its first three year of operations, 2006-2008 appear next: Heath Company estimates that 3% of sales...", "stars": 3 }, { "url": "\/study-help\/questions\/identify-the-accounting-concepts-that-relates-to-each-statement-listed-10030315", "description": "Identify the accounting concepts that relates to each statement Listed below are accounting concepts discussed in this chapter. a. Economic entity assumption b. Going concern assumption c....", "stars": 3 }, { "url": "\/study-help\/questions\/question-3-25-pts-if-the-total-differential-of-a-4397302", "description": "Question 3 25 pts If the total differential of a function is zero, then the function is constant. O True O False Question 4 25 pts The total differential of a function f(@, y) approximates how much...", "stars": 3 }, { "url": "\/study-help\/questions\/cybercriminals-and-ransomware-attacks-often-target-organizations-with-insecure-systems-999889", "description": "Cybercriminals and ransomware attacks often target organizations with insecure systems. As a database designer, you need to understand the secure database design. Read the topic Resource \"Security in...", "stars": 3 }, { "url": "\/study-help\/questions\/i-need-help-with-writing-part-2-i-wanted-to-3594748", "description": "I need help with writing part 2 I wanted to use the Maslows Hierarchy of needs for C. Module 03 Content This assessment will be a continuation of the survey design started in the discussion forum...", "stars": 3 }, { "url": "\/study-help\/questions\/air-travel-on-mountain-airlines-for-the-past-18-weeks-1008985", "description": "Air travel on Mountain Airlines for the past 18 weeks was: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 405 410 420 415 412 420 424 433 438 440 446 451 455 464 466 474 476 482 a. Explain why an...", "stars": 3 }, { "url": "\/study-help\/questions\/write-your-answers-with-the-correct-labels-where-calculations-are-1025882", "description": "Write your answers with the correct labels. Where calculations are required, clearly show how you arrived at your answer. Where explanation or discussion is required, support your answers with...", "stars": 3 }, { "url": "\/study-help\/questions\/1-an-orange-juice-producer-has-found-that-the-fill-1010768", "description": "1. An orange juice producer has found that the fill weights (weight of product per container) of several of its orange juice products do not meet specifications. If the problem continues, unhappy...", "stars": 3 } ], "next_back_navigation": { "previous": "\/study-help\/questions\/calculating-change-is-something-that-we-have-been-trained-to-8896437", "next": "\/study-help\/questions\/in-1988-sweet-acacia-limited-completed-the-construction-of-a-8896439" }, "breadcrumbs": [ { "name": "Study help", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers" }, { "name": "Computer Science", "link": "https:\/\/www.solutioninn.com\/study-help\/questions-and-answers\/computer-science" }, { "name": "Databases", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/computer-science-databases" }, { "name": "Write a defining table and a function to multiply each element in", "link": "https:\/\/www.solutioninn.com\/study-help\/questions\/write-a-defining-table-and-a-function-to-multiply-each-8896438" } ], "skill_details": { "skill_id": "656", "skill_name": "Databases", "parent_id": "8" } }