Giter Site home page Giter Site logo

scrabblescorer's Introduction

Lab 03.02: SCRABBLE® Scorer

Lab Description:

The purpose of this lab involves several components:

  1. Programmers must understand the concept of parallel lists.
  2. Programmers must understand what a lookup table is: Wikipedia - Lookup Table
  3. Programmers must understand the concept of O-notation for measuring algorithm efficiency and why searching a
  4. sorted set is more efficient than searching an unsorted set. Programmers must know how to parse string values one letter at a time.

Guidelines for Solutions:

To solve this problem, you must:

  • Create a Java class and name it ScrabbleScorer.java.
  • Use iteration to parse the user-input word one letter at a time
  • Use an int array called points to store the scoring value for each letter
  • Use an ArrayList of String values called dictionary that checks and validates user input from an imported text file (use the supplied SCRABBLE_WORDS.txt file)
  • Create some sort of invalid input handling statement to confirm diabolic input and prompt for re-entry
  • Loop the program indefinitely until the user enters 0

Sample input/output:

Enter a word to score or 0 to quit: quiz
quiz = 22 points
Enter a word to score or 0 to quit: abc
abc is not a valid word in the dictionary
Enter a word: hi there
hi there is not a valid word in the dictionary
Enter a word to score or 0 to quit: abc123
abc123 is not a valid word in the dictionary
Enter a word to score or 0 to quit: hello
hello = 8 points
Exiting the program thanks for playing

Point Values for Scrabble Letters:

|

A – 1 E – 1 I – 1 M – 3 Q – 10 U – 1
B – 3 F – 4 J – 8 N – 1 R – 1 V – 4
C – 3 G – 2 K – 5 O – 1 S – 1 W – 4
D – 2 H – 4 L – 1 P – 3 T – 1 X – 8

scrabblescorer's People

Contributors

a1cd avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.