- WordScramble.java
- WordScrambleTester.java
Grader Results
x/x
Pass | Test | Message | |
---|---|---|---|
- | Test results will show here. | - |
Errors:
This question involves reasoning about strings made up of uppercase letters. You will implement two related methods that appear in the same class (not shown). The first method takes a single string parameter and returns a scrambled version of that string. The second method takes a list of strings and modifies the list by scrambling each entry in the list. Any entry that cannot be scrambled is removed from the list.
Part b
Write the method scrambleOrRemove, which replaces each word in the parameter wordList with its scrambled version and removes any words that are unchanged after scrambling. The relative ordering of the entries in wordList remains the same as before the call to scrambleOrRemove. The following example shows how the contents of wordList would be modified as a result of calling scrambleOrRemove.
Before the call to scrambleOrRemove:
After the call to scrambleOrRemove:
Assume that scrambleWord is in the same class as scrambleOrRemove and works as specified, regardless of what you wrote in part (a). Complete method scrambleOrRemove.
This question involves reasoning about strings made up of uppercase letters. You will implement two related methods that appear in the same class (not shown). The first method takes a single string parameter and returns a scrambled version of that string. The second method takes a list of strings and modifies the list by scrambling each entry in the list. Any entry that cannot be scrambled is removed from the list.
Part b
Write the method scrambleOrRemove, which replaces each word in the parameter wordList with its scrambled version and removes any words that are unchanged after scrambling. The relative ordering of the entries in wordList remains the same as before the call to scrambleOrRemove. The following example shows how the contents of wordList would be modified as a result of calling scrambleOrRemove.
Before the call to scrambleOrRemove:
After the call to scrambleOrRemove:
Assume that scrambleWord is in the same class as scrambleOrRemove and works as specified, regardless of what you wrote in part (a). Complete method scrambleOrRemove.
Upload an image
Upload from your computer
Or paste a link here
Slides and Notes
No slides available for this video
About
Java (main)
Java Version 1.8.0_222