id/email
password
forgot password | create account
Or use
about | help | code help+videos | done | prefs
CodingBat code practice

 

getIQ


Given a person's writing sample, estimate their IQ using the following algorithm. Sum the length of each word, multiply by 15, then divide by the number of words (truncate any fractional part). Assume words are separated by whitespace and that there is no punctuation.

getIQ("i use short words") → 52
getIQ("mississippi expectations exceed extraordinary") → 157
getIQ("hello bye") → 60

...Save, Compile, Run

public int getIQ(String phrase){ }


Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Post-solution available

Copyright Nick Parlante 2016 - privacy