+ 1
Hi can anyone help me whith this
Given a sentence as input, calculate and output the average word length of that sentence. To calculate the average word length,you need divide the sum of all word length by the number of words in the sentence. Sample input given this is some text Sample Output 3.5 Explanation given: There are 4 words in the given input, with a total of 14 letters, so the average length will be : 14/4 = 3.5
1 Answer
+ 2
What is your difficulty there?
Find number of text in input without space.
/ divide by
Find no.of words by splitting input text by split method.
edit:
post your attempt if not successful...