0

Can someone have a look at this code for me and give me a hint about why it might not work in some instances?

My guess is that it has something to do with the rounding...this is my answer to one of the code coach quizzes. Any help will be much appreciated. Cheers 💪🏽 https://code.sololearn.com/cCA5L2GkahkS/?ref=app

1st May 2020, 4:25 PM
Andrea Botticini
Andrea Botticini - avatar
5 Answers
+ 2
Right awesome ! Thanks heaps Denise 💪🏽
1st May 2020, 5:38 PM
Andrea Botticini
Andrea Botticini - avatar
+ 2
c > A && c < Z || c > a && c < z //you have c >= A && c <= Z || c >= a && c <= z //you need
1st May 2020, 9:20 PM
zemiak
+ 1
Hello Andrea Botticini Did you know that String has a split() method? String s = "hello world" String[] arr = s.split(" "); -> [hello, world] Here is an example code which removes all punctuation: https://code.sololearn.com/c7bHiQgDC4zd/?ref=app Now you have a String array and can count each length of each word. Using math.ceil() is correct because you have to round up. Converting to int, print it, done. Hope this helps :)
1st May 2020, 5:33 PM
Denise Roßberg
Denise Roßberg - avatar
0
Andrea Botticini Your welcome :)
1st May 2020, 7:01 PM
Denise Roßberg
Denise Roßberg - avatar
0
I see that would have worked too 💪🏽 thanks for that zemiak
1st May 2020, 9:28 PM
Andrea Botticini
Andrea Botticini - avatar