about | help | code help+videos | done | prefs |
In SCRABBLE, different letters are assigned different numbers of points. Write a method computeScore(String word) that returns the score for a word without using either if or switch statements. Hint: find the position of a given letter in the alphabet string by calling indexOf; get the score for that letter from the array of point values, and add to the total. computeScore("marine") → 8 computeScore("medic") → 10 computeScore("firebat") → 12 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy