Question: in java** Create a menu that allows the user to pick the functionality that they want from the choices. When finished with it, present the
in java** Create a menu that allows the user to pick the functionality that they want from the choices. When finished with it, present the menu again until the user chooses to exit. A sample run of the menu might look like this. (Note that the menu also includes the bonus option, discussed next.) (Note that item 4 is for the optional bonus. Please include 4 in your menu, but it is ok that a request for 4 does nothing.) The user should be forced to enter a valid number: 1-5.
What would you like to do? 1: Get the score of a word 2: Get the average score of words in a file (one word per line) 3: Find the highest/lowest scoring words in a file 4: Sort words from a file into positive.txt and negative.txt 5: Exit the program Enter a number 1-5: 1 Enter a word: heartbreaking heartbreaking appears 11.0 times. The average score for reviews containing the word heartbreaking is 3.1818181818181817 What would you like to do? 1: Get the score of a word 2: Get the average score of words in a file (one word per line) 3: Find the highest/lowest scoring words in a file 4: Sort words from a file into positive.txt and negative.txt 5: Exit the program Enter a number 1-5: 2 Enter the name of the file with words you want to find the average score for: posTest.txt The average score of words in postest.txt is 2.2301454330735493 The overall sentiment of posTest.txt is positive What would you like to do? 1: Get the score of a word 2: Get the average score of words in a file (one word per line) 3: Find the highest/lowest scoring words in a file 4: Sort words from a file into positive.txt and negative.txt 5: Exit the program Enter a number 1-5: 3 Enter the name of the file with words you want to score: wordtist.txt The most positive word, with a score of 3.8333333333333335 is tears The most negative word, with a score of 0.125 is incoherent What would you like to do? 1: Get the score of a word 2: Get the average score of words in a file (one word per line) 3: Find the highest/lowest scoring words in a file 4: Sort words from a file into positive.txt and negative.txt 5: Exit the program Enter a number 1-5: 5 What would you like to do? 1: Get the score of a word 2: Get the average score of words in a file (one word per line) 3: Find the highest/lowest scoring words in a file 4: Sort words from a file into positive.txt and negative.txt 5: Exit the program Enter a number 1-5: 1 Enter a word: heartbreaking heartbreaking appears 11.0 times. The average score for reviews containing the word heartbreaking is 3.1818181818181817 What would you like to do? 1: Get the score of a word 2: Get the average score of words in a file (one word per line) 3: Find the highest/lowest scoring words in a file 4: Sort words from a file into positive.txt and negative.txt 5: Exit the program Enter a number 1-5: 2 Enter the name of the file with words you want to find the average score for: posTest.txt The average score of words in postest.txt is 2.2301454330735493 The overall sentiment of posTest.txt is positive What would you like to do? 1: Get the score of a word 2: Get the average score of words in a file (one word per line) 3: Find the highest/lowest scoring words in a file 4: Sort words from a file into positive.txt and negative.txt 5: Exit the program Enter a number 1-5: 3 Enter the name of the file with words you want to score: wordtist.txt The most positive word, with a score of 3.8333333333333335 is tears The most negative word, with a score of 0.125 is incoherent What would you like to do? 1: Get the score of a word 2: Get the average score of words in a file (one word per line) 3: Find the highest/lowest scoring words in a file 4: Sort words from a file into positive.txt and negative.txt 5: Exit the program Enter a number 1-5: 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
