I need help with these questions. A list of related data of the same type, refer
ID: 3729914 • Letter: I
Question
I need help with these questions.
A list of related data of the same type, referred to by a single variable name and an index number to identify each item is a array.
The ____ property of the Array object checks the size of an array at any time.
Each element of an array is identified by its _____ value.
The ______ method allows you to add several items to the end of an array.
The push() and unshift() methods add elements to arrays and return the ________ of the altered array.
True or False
6 T/FSince arrays are not the same as variables, you do not use the var keyword when you declare an array.
7 T/FThe values to be stored in an array can only be entered by the user at the time the array is created.
8 T/FParallel arrays must be of the same size.
9 T/FThe code to add an element to the beginning of an array named myArray[] is as follows:
10 T/FAnother word for “index” when referring to a specific element of an array is “subscript.”
11 T/FThe push() method allows the user to add one item to the beginning of an array.
12 T/FThe splice() method is used to add or remove items from an array.
13 T/FThe unshift() method inserts element values at the beginning of an array.
14 T/FA two-dimensional array has two subscripts.
15 T/FA two-dimensional array in JavaScript is actually an array of arrays.
Short Answer
16 Given the following array, what is the value of colors[3] ?
17 Given the following JavaScript code, what is displayed by the document.write() statement?
18 Given the following code, write statements that will assign the values requested:
Create a variable named adding that uses elements in the numbers array such that adding = 19.
Create a variable named divide that uses elements in the numbers array such that divide = 9.
19 Write JavaScript code to create an array named threes[] that has five elements. Use a loop to populate the array with the following sequence of numbers: 3, 6, 9, 12, 15.
20 Write JavaScript code to create an array named usernames[] that has 100 elements. Each element contains usernames for a school that assigns usernames to students. Each username concatenates the string "college" with a number. The numbers should start at 300 and end at 399.
21 Write JavaScript code to allow a business owner to enter the names of his employees and the number of hours each employee worked in a week. Use parallel arrays named employees[] and hours[] and a sentinel value so that the boss can enter as many employees as desired.
22 Given an array named items[] that holds the names of various items sold in a jewelry business. List three arrays that, as parallel arrays, will hold appropriate data to correspond with each item in items[] .
23 Given an array named snow[] that contains yearly snowfall amounts in inches in a certain area over a period of 10 years from 2000 to 2009. Use a loop to display these amounts. The output should be on 10 lines, each line of the following form:
where XXXX is the year and YY is the amount in inches.
Given: var snow = new Array(6, 8, 8, 12, 21, 15, 7, 8, 10, 15);
24 Add code to Exercise 23 to find and display the years with the highest and lowest snowfall amounts.
25 Add code to Exercise 24 to find the average snowfall over the 10 years.
26 Add code to Exercise 25 to find the number of years that snowfall was above the average.
27 Add code to Exercise 26 to find the number of years that snowfall was within two inches (above or below) the average.
28 Add code to the addRings() function of Example 8.14 in the chapter to check if a value Jackie wants to add to her inventory is already part of the inventory.
29 Add code to Example 8.14 in the chapter that will allow Jackie to enter her inventory of pendants and to add or subtract from that inventory.
30 Given the following JavaScript code, what are the values of the eight elements in the numbers[] array?
Explanation / Answer
If you have any problems with the answer or want me to edit the answer, just let me know in the comments and I will try to get on to it as soon as possible.
Do give a positive rating if you think this answer helped.
We are required to do only 4 parts of a question.
1. one-dimensional array is a list of related data having same type which are referred to by a single variable name with an index number to identify each element.
2. The length property is used to check the size of an array.
3. Each element in an array can be identified by its Index or subscript
4. Push() adds the elements at the end of the Array.
5. Push and unshift methods also returns the new length of the array.
8. Parallel array are of same but can be of different data types. Hence the given statement is TRUE.
11. Index of an array is also known as subscript. Hence the given statement is TRUE.
11. False push() adds elements at end of the Array. Hence the given statement is FALSE.
16. The index of Array start from 0 and here we have 4 elements therefore index will be 0,1,2,3 where index 3 represents fourth element. Hence the value of colors[3] will be mauve.