An English teacher is checking the length of words his students are using in their written essays. He asked each one of his students to write a sentence and then he need to get the average length of word for each student as he will give a prize for the student who have the maximum average word length. Help the teacher to know the name of the concerned student by implementing a Java program with the following steps: a. Write a Java method called averageStudentWordLength that takes one argument which is a 1D array of String of name sentence and return the average length of the sentence as a double value. b. Write a Java method called averageAllStudentWordLength that takes one argument which is a 2D array of String of name allStudentsSentence contains the sentences written by all students in the class and return the (as 1D array of double) the average word length for each of the sentence of student. This should be done by repeatedly calling the method averageStudentWordLength defined and implemented in point a c. Write a Java method called maxAverageWordLength that takes one argument which is a 1D array of double of name averagetWordLengths and return the maximum average length of the array averagetWordLengths. This should be done by calling the method averageAllStudentWordLength defined and implemented in point b. d. In the main method, • The program reads from the user the number of students in the class. • The program reads from the user set of rows (according to the number of students) such that each row contains students’ name and the sentence that student wrote. The program should store the students’ names in a separate single dimensional array and sentences are stored in a double-dimensional array of type String. You can consider that the number of employees in a branch is 20. • Then the program calls the methods defined in points a, b, and c to get the name of the student with the maximum average word length. • Finally, program prints the name of the winner student =========================== Sample Run: run: Enter number of students in the class: 10 Enter student 1 name and then his sentence (end with STOP): Ahmed Three can keep a secret, if two of them are dead. STOP Enter student 2 name and then his sentence (end with STOP): Ashraqat Genius is one percent inspiration and ninety-nine percent perspiration. STOP Enter student 3 name and then his sentence (end with STOP): Jana All that glitters is not gold. STOP . . . Enter student 10 name and then his sentence (end with STOP): Badr I'm gonna make him an offer he can't refuse. STOP TM105/M105 THE-Final 7 of 7 2020-2021/Fall >>>>>>>>>>>>>>>>>>> The Class has 10 Students and here are their sentences: Student 1 name: Ahmed, his average word length: 3.55, and his sentence is: Three can keep a secret, if two of them are dead. Student 2 name: Ashraqat, his average word length: 7.00, and his sentence is: Genius is one percent inspiration and ninety-nine percent perspiration. Student 3 name: Jana, his average word length: 3.79, and his sentence is: All that glitters is not gold. . . . Student 10 name: Badr, his average word length: 4.00, and his sentence is: I'm gonna make him an offer he can't refuse. Student Ashraqat got the maximum average word length: 7.00 BUILD SUCCESSFUL (total time: 3 minutes 11 seconds)
An English teacher is checking the length of words his students are using in their written essays. He asked each one of his students to write a sentence and then he need to get the average length of word for each student as he will give a prize for the student who have the maximum average word length. Help the teacher to know the name of the concerned student by implementing a Java
Trending now
This is a popular solution!
Step by step
Solved in 2 steps