Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Client-Side Scripting Midterm Exam What to submit Run your JavaScript program in the textbook Sandbox or other proper environment and submit: 1. A screenshot of

image text in transcribed
image text in transcribed
image text in transcribed
Client-Side Scripting Midterm Exam What to submit Run your JavaScript program in the textbook Sandbox or other proper environment and submit: 1. A screenshot of the program and final program output in one screen capture to prove that you run the code. Up to 20% off without screenshots. As example: 2. Your JavaScript program as a text file so that I can verify your code. You could copy and paste your code to MSword, txt, etc. Your name should appear as a comment. The Exam questions: 1. (20 points) Given the following array, write a program to calculate the a. sum of all the odd numbers in the array. No point assigned if manually picked the odd numbers and calculated the sum. b. Product of all the even numbers in the array [3,21,18,5,2,15,33,10,6,7] 2. (20 points) Write a program as follow: a. Create a function that takes a parameter i. The function generates a random whole number between 1 and 10 and then raise i to the power of the generated whole number(HINT: Math.pow()). The function then prints i, the random number and the result of the power. b. Pass the above function to the higher order function "repeat( n, action)" shown below using 6 as n. The function from step a. should be able to print the calculation result for 5 times as shown in the example output. You cannot modify the repeat function in any way. 0. points if not using the repeat function to perform the task 1. points off if the repeat function is modified function repeat( (n, action ){ for ( let i=0;i<>

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

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

Students also viewed these Databases questions