Read and prints highest valued legal scrabble word

Assignment Help Computer Networking
Reference no: EM13763571

You are to write a program that will read a file of scrambled 7-letter strings, and then prints out the highest valued legal Scrabble word(s). Before reading the file, your program will store a list of words read from the file words.txt. That file contains both legal and illegal words. Scrabble words are up to seven letters long, and are only composed of lowercase alphabetic characters. Your program will have to avoid storing the illegal words.

Your program should have a Word class that contains 1) a real Scrabble word stored in a string; and 2) the Scrabble value of the word. These Words must be stored in a set. You must create a map of letters to values, and use the map in determining the value of a word. The values, from 'a' to 'z' are 1, 3, 3, 2, 1, 4, 2, 4, 2, 8, 5, 1, 3, 1, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, and 10. I initialized an array of shorts, named
values, with these values, and then inserted them into the map.

The toughest part of this program is designing an algorithm to test all of the permutations of the file string and its substrings. You must use rotate and/or next_permutation to help in this task. Besides pp. 878-879 in the text, you will find more information on the web by searching for "STL rotate", or "next_permutation". You are not allowed to use any arrays or pointers in this program, other than the array of shorts named values. Your program must compile without warnings when compiled with -Wall -ansi. Your output must match mine exactly!

You will find words.txt, File1.txt, and my scrabble.out in ~ssdavis/40/p8

[ssdavis@lect1 p8]$ cat File1.txt
abcdefg
ableujk
ttabeed
olbisha
abjects
ytvxyzk
[ssdavis@lect1 p8]$ scrabble.out File1.txt
9 abcdefg: badge cafe face
15 ableujk: jake juke
10 ttabeed: abetted
13 olbisha: abolish
17 abjects: abject
0 ytvxyzk: No words found.
[ssdavis@lect1 p8]$

Reference no: EM13763571

Questions Cloud

Information on a mnc-publicly-traded company : Search the Internet for information on a MNC, publicly-traded company. Download the annual report for the most recent year reported; review the information contained on the company Website and proxy statement for use in this assignment. Review and..
Homicides committed with firearms : The difference between a perforating gunshot wound and a penetrating gunshot wound?
Read and prints highest valued legal scrabble word : You are to write a program that will read a file of scrambled 7-letter strings, and then prints out the highest valued legal Scrabble word(s). Before reading the file, your program will store a list of words read from the file words.txt.
Discuss the concept of domestic containment : Discuss the concept of "domestic containment". How did this concept operate in 1950's-1960's America? Why was it destined to ultimately fail? Give an example of one of the values present in domestic containment.
Read and prints highest valued legal scrabble word : You are to write a program that will read a file of scrambled 7-letter strings, and then prints out the highest valued legal Scrabble word(s). Before reading the file, your program will store a list of words read from the file words.txt.
Auditing cash and cash equivalents : Describe why there is a big emphasis placed on auditing cash and cash equivalents. Address the following:
What do you think of when you use the word church : What do you think of when you use the word church? How much of this is biblical and how much is cultural? Please explain and include material from your reading.
Why are data analysis skills and thinking so important : Why are data analysis skills and thinking so important to spend analysis. Can't software applications be used to generate the information needed automatically
Write critique of book is the healing of america by tr ried : Write the Critique of The Book is The Healing of America by T.R. Ried.

Reviews

Write a Review

Computer Networking Questions & Answers

  Design the new addressing scheme for the network

Strategy to upgrade the company's current infrastructure to support the new employees and recommend one strategy to create a high-performance network

  Write down a 200- to 300-word response to the given

write a 200- to 300-word response to the following what is the nature of digital signals binary and other multilevel

  Would you recommend buying the stdm multiplexer

Complete the following exercises from FitzGerald and Dennis, Business Data Communications and Networking, 10th ed.

  Discuss the tools that you want to put in place immediately

You've just taken a position as a network administrator for an 80-person company, and you are the only network administrator there. On the surface, it looks like everything has been working fine in the three months since the previous network admin..

  Design flowchart and pseudo-code for application

You will design a flowchart and pseudo-code for the application given below. Program will accept user input to store student's first and last name. If name is ZZZ, then the program will end.

  Some nefarious computer activities

Write a brief description of what they are, and include your assessment of whether the activities are something to worry about or not. This assignment requires two to three pages, based upon the APA style of writing.

  Segment network to reduce scope of compliance

To avoid having whole network subject to PCI specifications, how will you segment network to reduce scope of compliance?

  Overvieweach student will create a detailed unified

overvieweach student will create a detailed unified technical design of network services given the scenario. prepare

  Types of cable to make connection

Bank Corp. is planning new network. Engineers in design shop should have connections to accountants and salespeople in front officeWhat types of cable will work to make this connection?

  Suggest a sub-network design

Acme Computing Corp. has remote sites in Port Clinton and Napoleon in addition to their main site in Toledo. There are currently 29 devices connected to the network in Toledo. The corporate plan is to link the Port Clinton and Napoleon offices to ..

  . label the rows that make good power ciphers and explain

a) Make a power table for numbers mod 11. Indicate how the table shows Fermat's theorem, label the primitive roots mod 11. Explain how you can tell they are primitive roots. Label the rows that make good power ciphers and explain

  Describe threats to information security

Explain the relationship between privacy and IT. Describe some of the threats to information security and some of the measures you can take to protect information resources.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd