Complete the program named WordAvg below so that it reads in a string of one or more lines, determines the number of words in the string, counts the number of letters in each word, and prints out the average number of characters per word in the string. The average should be printed to two decimal places.

Input: a string containing one or more lines of words

Output: the average number of characters per word in the input string to two decimal places

For example, the string "Joe jumps to grab the ball" has six words (and five spaces). There are a total of 21 characters in the six words. So the average number of characters per word in this string is 3.50.

As another example, the string containing the following lines

    Peter Piper picked a peck of pickled peppers
    A peck of pickled peppers Peter Piper picked
    If Peter picked a peck of pickled peppers
    Wheres the peck of pickled peppers Peter Piper picked

contains a total of 33 words and 153 characters. So the average number of characters per word for this string is 4.64.

Complete the following file:

WordAvg.java

import java.util.Scanner; /** Determines the average number of characters for words in a string. Input: a string of one or more lines containing words Output: the average number of characters per word in the string to two decimal places */ public class WordAvg { public static void main(String[] args) { Scanner in = new Scanner(System.in); // your work here while (in.hasNext()) { String word = in.next(); // more work here } // more work here System.out.printf("%.2f\n", average); } }