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)

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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) =====================================================================

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY