Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 5: (30 Marks) An English teacher is checking the length of words his students are using in their written essays. He asked each one

image text in transcribed

Question 5: (30 Marks) 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: c. a. Write a Java method called averageStudentWordLength that takes one argument which is a 10 array of String of name sentence and return the average length of the sentence as a double value. b. Write a Java method called average AllStudent WordLength 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 average Student WordLength defined and implemented in point a Write a Java method called maxAverage WordLength 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 words in a sentence >>>>>> >>>>>>>>>> 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: 4.17, 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)

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_2

Step: 3

blur-text-image_3

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

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions

Question

List two relevant WHS policies and four WHS procedures

Answered: 1 week ago