Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Because the copied methods are intended to sort an array of ints, you will need

ID: 3770022 • Letter: B

Question

Because the copied methods are intended to sort an array of ints, you will need to change the int array parameters to string arrays. Also, the if condition in the indexOfNextSmalest method will need to be replaced with the following conditions used to compare the ordering of 12 string: Because the copied methods are not intended to sort partially-filled arrays, you will need to add an additional parameter to the selectionSort and indexOfNextSmallest method to indicate the number of "filled" elements in the array. This parameter will then need to be used in the loop conditions. You will also need to modify the method calls to include the appropriate argument.

Explanation / Answer

import java.util.Scanner; public class wordlistTO{ public static void main(String args[]) { int num1; String word; Scanner input = new Scanner(System.in); ArrayList wordlist = new ArrayList(); System.out.print("Welcome the wordlist"); System.out.print("--------------------"); System.out.print("1. Add Word"); System.out.print("2. Remove word"); System.out.print("3. Print word"); System.out.print("4. Quit"); System.out.print("choose an option 1-4:"); num1 = input.nextInt (); Scanner in = new Scanner(System.in); if (num1 == 1) { System.out.print("Enter a word to add to the word list :"); word = in.nextLine(); wordlist.add(word); } else if (num1 == 2) { System.out.print("Enter a word to remove to the word list :"); word = in.nextLine(); for (int i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote