Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need this in JavaScript and PHP The program for this Assessment will consist of two sections, each headed by the three-line comment below: //********************************************************* //****Assessment

Need this in JavaScript and PHP

The program for this Assessment will consist of two sections, each headed by the three-line comment below:

//*********************************************************

//****Assessment 2 Program 2 Section X

//*********************************************************

(where X stands for the portion of the Assessment to follow)

Assessment Requirements

Section 1:

  1. Enter the comment with the section title as described above.
  2. You will create a two-dimensional string array of 4x4 elements named salesRegions.
  3. The first column of the array will contain the names of the sales regions, North, South, East, and West. Columns 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
  4. Print to the console the statement, Section 1: Two-dimensional Array.
  5. Using nested loops, display the contents of the array by sales region. (See the expected output for an example.)

Section 2:

  1. Enter the comment with the section title as described above.
  2. 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.)
  3. 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.)
  4. Print to the console a blank line and the statement, Section 2: Array List.
  5. Using the methods available in the arraylist class, display the current number of elements in the salesTeam arraylist.
  6. Next, add the names of the people from the South region to the salesTeam arraylist.
  7. 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.
  8. Display the number of items in the salesTeam arraylist.
  9. Remove Janice and Ron from the salesTeam arraylist.
  10. Display the number of items in the salesTeam arraylist.
  11. 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

Perception: Making Sense of Your World

Answered: 1 week ago