Write a Java program Consider the structure of one example of inputs and outputs that is given in the first picture The structure of the code must be as it is shown in the second picture...




  • Write a Java program


  • Consider the structure of one example of inputs and outputs that is given in the first picture


  • The structure of the code must be as it is shown in the second picture


WordLengthes.java<br>1- þublic class WordLengthes {<br>2<br>public static void main(String[] args)<br>{<br>/lyour statements to test method here<br>4<br>6<br>7<br>//your method here...<br>}<br>8<br>

Extracted text: WordLengthes.java 1- þublic class WordLengthes { 2 public static void main(String[] args) { /lyour statements to test method here 4 6 7 //your method here... } 8
Instructions:<br>Write a Java static method called wordLengths() that accepts a string. Your method should count the number of letters in each word in the string, and output a<br>result diagram of how many letters contain each word. Use tabs before the asterisks so that they'lL line up.<br>You may assume that no word in the string is more than 80 characters in length and all words are space-separated.<br>Input:<br>Write a method called wordLengths that accepts a string<br>Output:<br>Three columns. The first column contains the order of word in the string (1, 2, 3, etc.) followed by a colon (e and space. The second column contains the<br>length of the word described by an integer. The 2nd and 3rd columns are separated by a single tab (6 spaces). The third column contains a histogram<br>representing the length of the corresponding word.<br>1: 5<br>2: 1<br>3: 6<br>4: 6<br>5: 11<br>6: 4<br>7: 7<br>8: 1<br>9: 6<br>

Extracted text: Instructions: Write a Java static method called wordLengths() that accepts a string. Your method should count the number of letters in each word in the string, and output a result diagram of how many letters contain each word. Use tabs before the asterisks so that they'lL line up. You may assume that no word in the string is more than 80 characters in length and all words are space-separated. Input: Write a method called wordLengths that accepts a string Output: Three columns. The first column contains the order of word in the string (1, 2, 3, etc.) followed by a colon (e and space. The second column contains the length of the word described by an integer. The 2nd and 3rd columns are separated by a single tab (6 spaces). The third column contains a histogram representing the length of the corresponding word. 1: 5 2: 1 3: 6 4: 6 5: 11 6: 4 7: 7 8: 1 9: 6

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here