Provide details on what you need help with along with a budget and time limit. Questions are posted anonymously and can be made 100% private.
Match with a Tutor
Studypool matches you to the best tutor to help you with your question. Our tutors are highly qualified and vetted.
Get Quality Help
Your matched tutor provides personalized help according to your question details. Payment is made only after you have completed your 1-on-1 session and are satisfied with your session.
need help in python, Computer Science Assignment Homework Help
User Generated
z6nn6
Computer Science
Description
Hello
i need help in this Please look at the attachment
Thank you
Unformatted Attachment Preview
A:1
B:3
C:3
D:2
E:1
F:4
G:2
H:4
I:1
J:8
K:5
L:1
M:3
N:1
O:1
P:3
Q:10
R:1
S:1
T:1
U:1
V:4
W:4
X:8
Y:4
Z:10
Objective
Using files to integrate the key concepts of Python we've discussed thus far.
Overview
The goal of the this assignment is to find the "word score values" in a game of Scrabble.
The primary objective to write a script to solve the problem described below. However, your program should have a "clean" design, meaning that functions/classes should be used where applicable and code should be adequately commented.
Instructions
• Create a class called Scrabble that has the following functions:
. A "Constructor" (_init_that accepts a single filename string for a file containing letter/value pairs. (An example is attached)
. This constructor should read the file and populate a "dictionary" of letter/value for use with the remaining methods of the class.
• A method/function called getWordValue() (in the class) that:
Accepts a single string as a parameter (the word who's value is to be found)
• Returns an integer of the Scrabble "word value for the provided word.
• A method/function called getBestWord() (in the class) that:
• Accepts a LIST of word strings.
• Returns a single string of the "best" word in the list (the word with the highest point value)
. A "main" function which:
• Creates an instance of the Scrabble class from a user supplied filename.
o Reads TWO parameters from the command line:
A file name containing the tile names (as illustrated in the attachment, of course, feel free to test your own values.)
. A word (or list of words):
• If the user enters a single word, display the point value of that word
• If the user enters a list of words (multiple words separated by commas), displays the best word in the list.
• As a clarific arion of what your main method might look like:
NOTE: THESE ARE JUST FRAGMENTS!!!
# Create a new scrabble scoring object
scoreMaker = new Scrabblel )
#if only a single word.
word Score = scoreMaker.getWordValue )
#if a list of words.
(word, word Score) = scoreMaker.getBestWord( )
# Display the appropriate output....
Examples:
aconover_LAB5.py c:\temp\tiles.txt apple
World value of apple is 9.
aconover_LAB5.py c:\temp\tiles.txt apple, squash
Bast value is squash with 18.
Submit
• Submit your resulting .py file (no other files are necessary)
. Please name it: _LAB5.py
. For example: aconover_LAB5.py
Purchase answer to see full
attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Would you like to help your fellow students? Are you in need of an additional source of income? Apply to become a tutor on Studypool! Our best tutors earn over $7,500 each month!