Solution in JAVA

by | Sep 4, 2021 | Assignment Help

Complete question and template is attached below. Solution should be in JAVA 1.8Summary: Implement a program that will process an array of strings (the words from the play Hamlet) in different ways. An Eclipse project template can be downloaded from the list below assignment page. Any code you add should use only arrays, not ArrayList or any other Collection or Map class.Change the project name to Lab5-yourname, substituting yourname with your name. Be sure to add appropriate comments before the main method.Find the following information from the string array. Do not read the file again.1. (10 pts.) Count the number of times the word Thou appears and print the indices where Thouoccurs. Your count should be between 10 and 20. The first index is 339, and the last index is 29028. Hint: something like word.equals(“Thou”) might be useful for this.2. (10 pts.) Print all the words with length 13 on one line, all 46 of them. The first one is Ship-wrights, (yes, there is a comma in the word) and the last one is Guildensterne. Hint: something like word.length() == 13 might be useful for this.3. (20 pts.) Repeatedly ask the user for a string to search for until the user enters quit. Print the number of words that contain that string. Also print up to the first 10 words that contain that string. Hint: something like word.contains(searchString) might be useful for this. Example: 86 words contain vn, the first 10 are:vnfold vnimproued vnto vnmanly vnfortified, vnschool’d: vnpreuayling vnforc’d vnprofitable vnweededAnother example: 163 words contain eu, the first 10 are:relieu’d beleeue euen euer beleeue Exeunt. Leuies, euer perseuer peeuish4. (Extra Credit) Ask the user for a index into the array. The user should be asked repeatedly until a valid index is entered. Print the word at that index, the 10 previous words, and the 10 next words. The words should be printed in this way on three lines: the 10 previous words, a newline, the word at that index, a newline, the 10 next words, and a newline. Do something reasonable if the index is near 0 or the length of the string array.5. (Extra Credit) Find the character (Unicode character from 32 to 126) that occurs the most. Print the character and how many times it occurs. Suggestion: Create an int array of length 127 which stores a count of each character. If the array is named counts, and you have a char named ch, then counts[ch]++ will increment the count for that character. This will require a double loop. The outerloop goes through the words. The inner loop goes through the characters in the current word.6. (Extra Credit) For item 2, do not print any words twice. Your solution should work whether I change 13 to any other number. Use only arrays, not ArrayList or any other Collection or Map class.Rubric: •Programs with compilation errors may receive 0 points for Part One.•Programs that add code using ArrayList or any other Collection or Map class may receive 0 points.•(10 pts.) ?You renamed the project as described above. Right click on project > Refactor > Rename.?Comments: your name, class name, instructor name, date, summary. Also, each method should have a comment.?Programming style: following conventions, such as good variable names and prompts.•(40 pts.) The program implements items 1-3 as described above (20 points for item 3).•(20 pts. extra credit each) For items 4-6.

This is a sample question

Need help with a similar assignment?

Place an order at Study Pirate

Attach all custom instructions.

Make Payment. (The total price is based on number of pages, academic level and deadline)

We’ll assign the paper to one of writers and send it back once complete.