Answered step by step
Verified Expert Solution
Question
1 Approved Answer
INTRODUCTION Your professor, likes to watch tv series. One of these shows caught his attention, thoe speeches seems more enticing to his ears than any
INTRODUCTION Your professor, likes to watch tv series. One of these shows caught his attention, thoe speeches seems more enticing to his ears than any other show he has ever watched before. For some time, he could not figure out the reason for that, until one day he realized that this show had various vocabulary. Acting scenes are full of long speeches, decent acting, and most importantly, certain vocabulary almost never gets repeated in the entire show Your professor, being the nerd, he is, forms a theory "A show that has the least repeated vocabulary should be ranked among the best shows. " The theory states that if story A and story B have the same number of words in them, and storyA has less repeated words in it than that of story B, then story A is a better story You are given 4 different stories as text documents of roughly the same size, 4600 words. In this assignment, your professor is asking you to build a tool that loads these stories and prints them in the order of their vocabulary ranks. REQUIREMENTS You are given hw5.java below. This class has a main function that invokes two other classes: StoryRanker and Story. You are required to write StoryRanker.java and Story.java, and submit them along with hw5.java on blackboard. import java.io.FileNotFoundException; import iava.util.Scanner public class Hu5 t public static void nain (String[] args) throws FileNot FoundException t String user!nput ""; Scanner in new Scanner(System.in); System.out.printin("Write a file nane to include in your ranks,'?"* + "to list ranks, andto exit program"); while (!userInput.equals("!")) Systen.out.print(">) userInputin.next); if (userInput.equals(!) System.out.print1n(nGood Bye )"); StoryRanker.printRanks() Story myStorynew Story(userInput); else if (userInput.equals("")) else ( if (myStory.getWordCount() > ) StoryRanker.addStory(nyStory); INTRODUCTION Your professor, likes to watch tv series. One of these shows caught his attention, thoe speeches seems more enticing to his ears than any other show he has ever watched before. For some time, he could not figure out the reason for that, until one day he realized that this show had various vocabulary. Acting scenes are full of long speeches, decent acting, and most importantly, certain vocabulary almost never gets repeated in the entire show Your professor, being the nerd, he is, forms a theory "A show that has the least repeated vocabulary should be ranked among the best shows. " The theory states that if story A and story B have the same number of words in them, and storyA has less repeated words in it than that of story B, then story A is a better story You are given 4 different stories as text documents of roughly the same size, 4600 words. In this assignment, your professor is asking you to build a tool that loads these stories and prints them in the order of their vocabulary ranks. REQUIREMENTS You are given hw5.java below. This class has a main function that invokes two other classes: StoryRanker and Story. You are required to write StoryRanker.java and Story.java, and submit them along with hw5.java on blackboard. import java.io.FileNotFoundException; import iava.util.Scanner public class Hu5 t public static void nain (String[] args) throws FileNot FoundException t String user!nput ""; Scanner in new Scanner(System.in); System.out.printin("Write a file nane to include in your ranks,'?"* + "to list ranks, andto exit program"); while (!userInput.equals("!")) Systen.out.print(">) userInputin.next); if (userInput.equals(!) System.out.print1n(nGood Bye )"); StoryRanker.printRanks() Story myStorynew Story(userInput); else if (userInput.equals("")) else ( if (myStory.getWordCount() > ) StoryRanker.addStory(nyStory)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started