Back to Library
QID: #22975
Solution for QID #22975: Write a program that asks the user for a word. Next, open up | StudyHelpMe
Write a program that asks the user for a word. Next, open up the movie_reviews.txt file and examine every review one at a time. If a review contains the desired word you should make a note of the review score in an accumulator variable. Finally, produce some output that tells your user how that word was used across all reviews as well as the classification for htis word (any score of 2.0 or higher can be considered "positive" and any score less than 2.0 can be considered "negative). For example:
Enter a word to test: happy
'happy' appears 17 times
The average score for reviews containing the word 'happy' is 2.588235294117647
This is a positive word
Enter a word to test: awful
'awful' appears 23 times
The average score for reviews containing the word 'awful' is 1.0869565217391304
This is a negative word
Enter a word to test: pikachu
'pikachu' appears 0 times
There is no average score for reviews containing the word 'pikachu'
Cannot determine if this word is positive or negative
ZERO AI
Human Written
Human Written
PHD EXPERTS
Verified
Verified
TURNITIN
Clean Report
Clean Report
FAST DELIVERY
Instant/Hourly
Instant/Hourly