Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i want an answer like output without import java.text.DecimalFormat; Please Use only import java.util.Scanner; Question 5: (30 Marks) An English teacher is checking the length

image text in transcribedimage text in transcribed

i want an answer like output

without import java.text.DecimalFormat; Please

Use only import java.util.Scanner;

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: 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 maxAverage WordLength that takes one argument which is a 10 array of double of name averagetWordLengths and return the maximum average length of the array averaget WordLengths. This should be done by calling the method average All StudentWordLength 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 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)

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

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Luc Perkins, Eric Redmond, Jim Wilson

2nd Edition

1680502530, 978-1680502534

More Books

Students also viewed these Databases questions

Question

Describe what is PHP and .NET. Compare and contrast PHP vs .NET

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago