Question

1. Assuming each line of information is stored in a new array, which of the following...

1. Assuming each line of information is stored in a new array, which of the following pairs are not parallel arrays?

A. names of all students at Santa Fe College

ID numbers of all students at Santa Fe College

B. names of all students at Santa Fe College

names of all students taking JavaScript at Santa Fe College

C. names of all students at Santa Fe College

email addresses of all students at Santa Fe College

D. All three sets shown are examples of parallel arrays.

2. Given the following array, which statement will create a variable named product that multiplies 4 * 5, using array elements?

var nums = new Array(2, 3, 4, 5, 6, 30, 40, 50, 60);

A. var product = nums[1] * nums[2];

B. var product = nums[2] * nums[3];

C. var product = nums[3] * nums[4];

D. var product = nums[4] * nums[5];

3. Which statement will add the value stored in the variable pizza to the food() array given below?

var food = new Array("burger", "chips", "subs", "lasagna");

var pizza = "pepperoni pizza";

A. food[0] = pizza;

B. pizza.push(food);

C. food.push(pizza);

D.. This cannot be done.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.

B. names of all students at Santa Fe College
names of all students taking JavaScript at Santa Fe College

Explanation: names of javascript only will give lesser elements

2.

B. var product = nums[2] * nums[3];

Explanation: Indices start from 0 and not 1.

3.

C. food.push(pizza);

Please up vote

Add a comment
Know the answer?
Add Answer to:
1. Assuming each line of information is stored in a new array, which of the following...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Given the following array, what is the value of pets[3]? var pets = new Array("giraffe",...

    1. Given the following array, what is the value of pets[3]? var pets = new Array("giraffe", "pig", "beetle", "hamster", "spider", "goldfish", "cow"); A. pig B. beetle C. hamster D. spider 2. Given the following array, which statement will create a variable named product that multiplies 4 * 5, using array elements? var nums = new Array(2, 3, 4, 5, 6, 30, 40, 50, 60); A. var product = nums[1] * nums[2]; B. var product = nums[2] * nums[3]; C. var...

  • 1. Which of the following code snippets will load an array named fives(), consisting of 10...

    1. Which of the following code snippets will load an array named fives(), consisting of 10 elements with the starting value of the first element = 0 and will load each subsequent element counting by 5's, ending with the last element = 45. In other words, the elements in the fives() array should be (0, 5, 10, 15, ... 45).   A. var fives = new Array(); for(j = 1; j < 11; j++)      fives[j] = j + 5; B. var...

  • 1. True or False: The selection sort cannot be used to sort strings. A. True B....

    1. True or False: The selection sort cannot be used to sort strings. A. True B. False 2. The __________ search is most efficient for large amounts of data. A. binary B. serial C. selection D. bubble 3. What will be displayed after the following code is executed? var chips = new Array("plain", "onion", "tuna", "barbecue", "cheddar"); document.write("There are " + chips.length + 1 + " types of chips."); document.write("My favorite is " + chips[2] + "."); A. There are...

  • Which of the following functionality can NOT be developed using JavaScript only? Question 1 options: A...

    Which of the following functionality can NOT be developed using JavaScript only? Question 1 options: A monthly calendar Adding some numbers A live clock showing date and time A synchronous chat room with multiple people from different places Showing different text based on time of the day. Question 2 (0.5 points) Saved In the following JavaScript statement, what is the value of course[3]? var course = new Array(4203, 89, 95, 77, 5443); Question 2 options: 4203 77 95 null 5443...

  • Using the following parallel array and array of vectors: // may be declared outside the main...

    Using the following parallel array and array of vectors: // may be declared outside the main function const int NUM_STUDENTS =3; // may only be declared within the main function string Students[NUM_STUDENTS] = {"Tom","Jane","Jo"}; vector <int> grades[NUM_STUDENTS] {{78,98,88,99,77},{62,99,94,85,93}, {73,82,88,85,78}}; Write a C++ program to run a menu-driven program with the following choices: 1) Display the grades 2) Add grade 3) Remove grade for all students for a selected assignment 4) Display Average for each student 5) Display the name of...

  • A method called linearSearch(), which takes as parameters an array of int followed by three values...

    A method called linearSearch(), which takes as parameters an array of int followed by three values of type int, and returns a value of type int. The first int parameter represents a key, the second int parameter represents a starting position, and the third int parameter represents an end position. If the key occurs in the array between the start position (inclusive) and the end position (exclusive), the method returns the position of the first occurrence of the key in...

  • CT143 : Intro to C++ Lab 15: Array Practice Instructions Complete each of the C++ activities...

    CT143 : Intro to C++ Lab 15: Array Practice Instructions Complete each of the C++ activities described below in a single source file Label each activity with its own heading using comments. Activities: 1) Favorite numbers a. Declare and initialize an array of 10 integers as a single statement using a name of your choice. b. Output the result of adding the 1st and 5th members of the array. C. Subtract the 4h member from 3 times the 10th member...

  • In this project, you’ll read in and manage hotel reviews from several reviewers. This will require...

    In this project, you’ll read in and manage hotel reviews from several reviewers. This will require you to create a two-dimensional array (reviewers x hotels) as well as parallel arrays to hold associated data. You’ll also implement a sorting algorithm which will require you not only to sort in the traditional way, but to maintain parallelism among data. There won’t be any exciting UI here, just some output of array data, and hotel/review data coming from a file. 2   Input...

  • 1.The following statement gets an element from position 4 in an array named myArray: x =...

    1.The following statement gets an element from position 4 in an array named myArray: x = myArray[4]; What is the equivalent operation using an array list named list.? A x = list.get(); B x = list.get(4); C x = list.get[4]; D x = list[4]; 2.Consider the following code snippet: ArrayList<Integer> num1 = new ArrayList<Integer>(); int data; Scanner in = new Scanner(System.in); for (int i = 0; i < 5; i++) { data = in.nextInt(); num1.add(data); if (data == 0 &&...

  • PLEASE DO IN JAVA 1) Create interface named “Person” which exposes getter/setter methods for the person’s...

    PLEASE DO IN JAVA 1) Create interface named “Person” which exposes getter/setter methods for the person’s name and college ID: 1. getName 2. setName 3. getID 4. setID. The college ID is represented as “int”. Define two classes, Student and Faculty, which implement Person. Add field GPA to Student and department to faculty. Make them private and create corresponding getters (getGPA, getDepartment) and setters (setGPA, setDepartment). Use appropriate types. 2) Write a class College, which contains the name of the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT