subject

You are on a team of developers writing a new teacher tool. The students names are stored in a 2D array called “seatingChart”. As part of the tool, a teacher can enter a list of names and the tool well return the number of students in the class found with names that matching provided list. For this problem you will be completing the ClassRoom class in the problem below. Your job is to complete the numberOfStudents found method. This method accepts an array of Strings that contain names and returns the quantity of students with those names. For example: Assume that a ClassRoom object named “computerScience” has been constructed and the seating chart contains the following names:

“Clarence”, “Florence”, “Ora”

“Bessie”, “Mabel”, “Milton”

“Ora”, “Cornelius”, “Adam”

When the following code executes:

String[] names = {"Clarence", "Ora", "Mr. Underwood"};
int namesFound = computerScience. numberOfStudents(names);
The contents of namesFound is 3 because Clarence is found once, Ora is found twice, and Mr. Underwood is not found at all. The total found would be 3.

Complete the numberOfStudents method
public class ClassRoom
{

private String[][] seatingChart;

//initializes the ClassRoom field seatingChart
public ClassRoom(String[][] s){
seatingChart = s;
}

//Precondition: the array of names will contain at least 1 name that may or may not be in the list
// the seating chart will be populated
//Postcondition: the method returns the number of names found in the seating chart

//TODO: Write the numberOfStudents method

public int numberOfStudents(String[] names){

}

public static void main(String[] args)
{
//DO NOT ENTER CODE HERE
//CHECK THE ACTUAL COLUMN FOR YOUR OUTPUT
System. out. println("Look in the Actual Column to see your results");
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
Perform the following tasks: a. create a class named testclass that holds a single private integer field and a public constructor. the only statement in the constructor is one that displays the message “constructing”. write a main()function that instantiates one object of the testclass. save the file as testclass.cpp in the chapter 08 folder. run the program and observe the results. b. write another main()function that instantiates an array of 10 testclass objects. save the file as test class array.c . run this program and observe the results.
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
Select the correct answer. andre was recently hired by an organization to check for system vulnerabilities. he is supposed to exploit these vulnerabilities and create a report on the extent of damage to which the system was susceptible. what position does andre hold in this organization? a. information security analyst b. information assurance manager c. penetration tester d. network security engineer e. chief information security officer
Answers: 2
question
Computers and Technology, 23.06.2019 16:30
20 points archie wants to use a reflector as he photographs a newlywed couple. what would he consider in his choice? a. shadow and sunny b. homemade and professional c. lamps and boards d. incident and reflected e. neutral density and enhancement
Answers: 3
question
Computers and Technology, 24.06.2019 02:30
Which option completes the explanation for conflict of interest in an organization
Answers: 1
You know the right answer?
You are on a team of developers writing a new teacher tool. The students names are stored in a 2D ar...
Questions
question
Geography, 23.03.2021 20:50
question
Mathematics, 23.03.2021 20:50
question
Mathematics, 23.03.2021 20:50
question
Mathematics, 23.03.2021 20:50