Outcomes addressed in this activity:
Unit Outcomes:
Explain the need for multi-dimensional arrays.
Create a multi-dimensional array.
Course Outcome practiced in this unit:
IT232-2: Compose software using advanced interface and program design techniques.
Purpose
The purpose of this assignment is to provide you with an opportunity to demonstrate knowledge of creating and manipulating multi-dimensional arrays and array lists.
Assignment Instructions
You will complete a single program containing multiple sections to demonstrate the skills presented in this lesson for your selected language path. Please keep in mind that with all the assignments in this course, any given scenarios are hypothetical and intended solely to demonstrate specific skills.
Note: If your language of choice is Web Development, you will need to complete the exercises in both PHP and JavaScript.
Using the language in which you have chosen to focus: C#, Java, Web Development languages (PHP and JavaScript), please complete the following Assignment:
The program for this assignment will consist of two sections, each headed by the three-line comment below:
//*********************************************************
//****Assignment 3 Section X
//*********************************************************
(where X stands for the portion of the assignment to follow)
Assignment Requirements
Section 1:
Enter the comment with the section title as described above.
You will create a two-dimensional string array of 4×4 elements named salesRegions.
The first row of the array will contain the names of the sales regions, North, South, East, and West. Rows 2, 3, and 4 will contain the names of the personnel in charge of those sales regions and are listed below. Fill the array with this data.
North
South
East
West
Bob
Sue
Nathan
Wanda
Stef
Janice
Henry
Charles
Ron
Will
Kimmy
Pete
Print to the console the statement, “Section 1: Two-dimensional Array.”
Using nested loops, display the contents of the array by sales region. (See the expected output for an example.)
Section 2:
Enter the comment with the section title as described above.
Create an arraylist called salesTeam. The arraylist will contain the names of the sales team members responsible for the sales in that region. (Hint: This is using the collection tool, arraylist, and is not a standard array like the two-dimensional array in section 1.)
Once created, use the two-dimensional array to add the names in the North region to the salesTeam arraylist. (Notice: You are just adding the names of the people, not the name of the region. So, in this case the names added should be Bob, Stef, and Ron.)
Print to the console a blank line and the statement, “Section 2: Array List.”
Using the methods available in the arraylist class, display the current number of elements in the salesTeam arraylist.
Next, add the names of the people from the South region to the salesTeam arraylist.
Using the appropriate method available in the arraylist class, check to see if “Stef” is in the salesTeam arraylist and print a statement as to whether or not Stef is in the list.
Display the number of items in the salesTeam arraylist.
Remove Janice and Ron from the salesTeam arraylist.
Display the number of items in the salesTeam arraylist.
Using a loop, display “Names currently in the salesTeam arraylist.” followed by all the elements remaining in the salesTeam arraylist.
EXPECTED OUTPUT
Section 1: Two-dimensional Array.
North
Bob
Stef
Ron
South
Sue
Janice
Will
East
Nathan
Henry
Kimmy
West
Wanda
Charles
Pete
Section 2: Array List.
There are 3 names in the salesTeam arraylist.
Stef is in the salesTeam arraylist.
There are 6 names in the salesTeam arraylist.
There are 4 names in the salesTeam arraylist.
Names currently in the salesTeam arraylist.
Bob
Stef
Sue
Will
Directions for Submitting Your Assignment
The source code file is the file in your project that contains the code you wrote. You will only need to submit the source code file for your program and not the entire project folder or any additional project files. Below are listed the file extensions for the source code file for each language:
.cs file for C#
.java file for Java
.php and .js files for Web Development
Place this order or similar order and get an amazing discount. USE Discount code “GET20” for 20% discount