1 answer

Write a JavaScript program that will do the following: Create an array of size 50. Store randoml...

Question:

Write a JavaScript program that will do the following:

  • Create an array of size 50.
  • Store randomly generated number (between 0 and 10) into this array.
  • Ask users what number they want to search in the array. Make sure user given number is between 0 and 10.
  • Search the user given number in the array:
    • If the program found the number in the array then display all the indexes where the number was found.
    • If the program does not find the number in the array then give an appropriate message e.g. “number not found!”
  • Write a function to solve this problem.

Answers

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Here a new web page with name "jsArray.html" is created, which contains following code.

jsArray.html :

======================================================

Output : Open web page jsArray.html in the browser and will get the screen as shown below

Screen 1 :jsArray.html, screen asking to enter number to search

C Javascript array fX localhost:8080/jsArray.html localhost:8080 says Enter number to search Cancel OK

Screen 2 :Screen showing number indices

Javascript array С localhost:8080/jsArray.html 11 15 36 40

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

.

Similar Solved Questions

1 answer
62) Which of the following statements is NOT correct. a) REM sleep deprivation causes irritability, fatigue,...
62) Which of the following statements is NOT correct. a) REM sleep deprivation causes irritability, fatigue, and memory loss everyone dreams C) REM periods become longer as the number of hours of sleep increases d) everyone dreams in color. 63) Mrs. Zumpano, a second grade teacher, believes that boy...
1 answer
A molecule can behave as an acid in one reaction but as a base in another...
a molecule can behave as an acid in one reaction but as a base in another reaction m. True or false? if true, provide an example molecule that exhibits this behavior...
1 answer
On January 1, 2014, Hoosiers Corp. had beginning inventory of 1,000 units at a cost of...
On January 1, 2014, Hoosiers Corp. had beginning inventory of 1,000 units at a cost of $15 per unit. During 2014 Hoosiers made the following purchases: Date March 15 June 15 September 15 December 15 Unit Quantity and Unit Cost 1,000 units at $17 per unit 1.000 units at $19 per unit 1,000 units at $2...
1 answer
A person's level of blood glucose and diabetes are closely related. Let x be a random...
A person's level of blood glucose and diabetes are closely related. Let x be a random variable measured in milligrams of glucose per deciliter (1/10 of a liter) of blood. Suppose that after a 12-hour fast, the random variable x will have a distribution that is approximately normal with mean μ...
1 answer
12.57 A logistic growth model for world population, f(x), in bilions, x years after 1968 is...
12.57 A logistic growth model for world population, f(x), in bilions, x years after 1968 is f(x) 1+4.11e-0026x According to this model when will the world population be billion According to this model, the world population will be 7 bilion in I (Round to the nearest whole number as needed)...
1 answer
Economic literacy pearson aut the med to betton Aome to be
economic literacy pearson aut the med to betton Aome to be...
1 answer
Required information [The following information applies to the questions displayed below.] Phoenix Company’s 2017 master budget...
Required information [The following information applies to the questions displayed below.] Phoenix Company’s 2017 master budget included the following fixed budget report. It is based on an expected production and sales volume of 15,000 units. PHOENIX COMPANY Fixed Budget Report For Year E...
1 answer
Just double check my answer. ANSWER ONLY, NO explanation needed Submit E1 Q8 Homework. Unanswered The...
Just double check my answer. ANSWER ONLY, NO explanation needed Submit E1 Q8 Homework. Unanswered The rents for apartments in Suburbsville have increased by $100 this year. Yet more apartments have been rented out this year relative to last year. What is the best explanation for this? O A The...
1 answer
What is the integral of #int cos(x)sin(sin(x))dx#?
What is the integral of #int cos(x)sin(sin(x))dx#?...
1 answer
Required information [The following information applies to the questions displayed below.) Project A requires a $365,000...
Required information [The following information applies to the questions displayed below.) Project A requires a $365,000 initial investment for new machinery with a five-year life and a salvage value of $37,500. The company uses straight-line depreciation. Project A is expected to yield annual net i...
1 answer
Give IUPAC names for the following compounds: Cl CH2CH.COCHCH3 CH3 CH3 CH3 1st structure: 2nd structure:
Give IUPAC names for the following compounds: Cl CH2CH.COCHCH3 CH3 CH3 CH3 1st structure: 2nd structure:...
1 answer
Suppose that the heights of adult men in the United States are normally distributed with a mean of inches and a standard deviation of inches
Suppose that the heights of adult men in the United States are normally distributed with a mean of inches and a standard deviation of inches. What proportion of the adult men in United States are more than feet tall? (Hint: feet inches.) Round your answer to at least four decimal places....
1 answer
A tensile force of 120 kN is applied on a 0.02-m diameter and 2-m long rod....
A tensile force of 120 kN is applied on a 0.02-m diameter and 2-m long rod. After applying the load, the diameter of the rod decreases to 0.01998 m and the length increases to 2.01 m. The engineering stress on that rod is most nearly: PLEASE SHOW ALL WORK. A tensile force of 120 leN is applied on a...
1 answer
Section B: Short Exercises (10 Marks) BI - At December 31, 2019, account balances after adjustments...
Section B: Short Exercises (10 Marks) BI - At December 31, 2019, account balances after adjustments for Mark Company follows: [AR1: 5 marks] Accounts Cash Supplies Equipment Accumulated Depreciation-Equipment Notes Payable Accounts Payable Mark's, Capital Mark's, Drawings Service Revenue Adv...
1 answer
Assignment Scenario that you need to answer: Suppose you administer a certain aptitude test to a...
Assignment Scenario that you need to answer: Suppose you administer a certain aptitude test to a random sample of 9 students in your high school, and the average score is 105. Assume a standard deviation of ? = 15 for the test. We want to test that the average aptitude test is more than 100 at the ?...
1 answer
Exercise 10-8 Allocating product costs between ending inventory and cost of goods sold LO 10-3 Vernon...
Exercise 10-8 Allocating product costs between ending inventory and cost of goods sold LO 10-3 Vernon Manufacturing Company began operations on January 1. During the year, it started and completed 1,660 units of product. The financial statements are prepared in accordance with GAAP. The company incu...
2 answers
Seven students each stent 15 minutes at the classroom computer
seven students each stent 15 minutes at the classroom computer. an eighth studentworked 18 minutes. what is the tolal computer time in minutes and hours...