---
# System prepended metadata

title: 'Summer: Assignment 2 - Coding Lab (Arrays)'
tags: ['''23-''24']

---

# Summer: Assignment 2 - Coding Lab (Arrays)

## Objective:
The objective of this assignment is to reinforce your understanding of declaring, assigning, and accessing data in JavaScript Arrays.

Alma is no longer working and your teachers are having trouble keeping track of which students are taking which classes. There are 5 classes (CS,  Math, ELA, Social Studies, Electives)

## Instructions

### Part 1 [2 pts]

1. Create an array for each class with the following names: `csRoster, mathRoster, elaRoster, ssRoster, electivesRoster`.
2. Store the names of 5 unique students (create random names) in each array.

    - **[1.3: 2 pts]**

### Part 2 [2 pts]

1. After creating your arrays and assigning values to them. 5 new students enrolled at CSH. The names of the students are: `JP, Arnold, Peach, Laila, Jayden`
2. Use the push() method to add ONE of these new students to each of the class rosters as below:
    * Add JP to CS
    * Add Arnold to Math
    * Add Peach to ELA
    * Add Laila to Social Studies
    * Add Jayden to Electives

    -  **[1.3: 2 pts]**


### Part 3 [2 pts]

1. After a few weeks of classes, Jayden's family realized they have to leave the state and Jayden has to unenroll from CSH.
2. Use an array method to remove him from the electives roster.

    -  **[1.3: 2 pts]**

## Extra Credit [2 pts]

1. Create a new array with the following name: `cshRosters`
2. Store the previously created rosters in this array. Rosters should have the following indexing inside `cshRosters`
    | Roster                | Index | 
    | --------              | -------- | 
    |  `csRoster`           | 0     |
    |  `mathRoster`         | 1     |
    |  `elaRoster`          | 2     |
    |  `ssRoster`           | 3     |
    |  `electivesRoster`    | 4     |

    -  **[1.3: 1 pt]**

4. Use ONLY the `cshRoster` and list indexing to print the name of the second student in the `ssRoster` 

    -  **[1.3: 1 pt]**