Question: import java.util.Scanner; // This program uses a method letterValue to determine the numeric value of a letter in Scrabble // Scrabble values: // A,E,I,O,U,L,N,S,T,R =

import java.util.Scanner;

// This program uses a method letterValue to determine the numeric value of a letter in Scrabble

// Scrabble values:
// A,E,I,O,U,L,N,S,T,R   = 1
// D,G = 2
// B,C,M,P = 3
// F, H, V, W, Y = 4
// K = 5
// J, X = 8
// Q, Z = 10

public class ScrabbleValue
{
/**
Finds the point value of a letter in Scrabble
@param ch the character to be evaluated
@return the letter point value (int)
*/
public static int letterValue(char ch)
{
int value = 0;
//-----------Start below here. To do: approximate lines of code = 23
// Use a switch statement to determine the value of a letter and return that value.
// See the comments above for Scrabble values.
// Convert ch to an uppercase letter first before using it in the switch statement

Step by Step Solution

3.48 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

ch CharactertoUpperCasech switch ch case A case E case I case O case U case L ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!