Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions