1. Engineering
  2. Computer Science
  3. java question please...

Question: java question please...

Question details
Java question please
Extra Credit 5% extra credit can be earned by completing the following challenge in the class with the main () method, add a method called averageLength that takes any number of String parameters. The method should compute and return the average length the strings as a double. If no strings are passed to the method, it should return 0. You will receive up to 2% extra credit if you complete the method correctly with no restrictions. You will receive up to 5% extra credit if you are able to complete the method using only a single Java statement. The image below shows some example calls to the method and the correct output: System.out.printIn(averageLength(abc, а, abcdefg, length, -1234567890)); 40 System.out.println(averagelengthC abc)); 41 System.out.println averagel ength)); 43 System.out.println(averagel ength(words)); console X String[] words-{ -Charles, Bryan, UNT, School of Engineering and Technology }; sterminated> StreamExamples (Java Application) A.ibrarylJaval JavavirtualMachines/jdk1.8.0.144.jdk/Contents/Home/birvjava (Sep 21, 2018, 2:402 5.4 3.0 0.0 12.75
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution