Question
USE JAVA LANGUAGE 1. Write a method called listUpper() that takes in a list of strings, and returns a list of the same length containing
USE JAVA LANGUAGE
1. Write a method called listUpper() that takes in a list of strings, and returns a list of the same length containing the same strings but in all uppercase form. You can either modify the provided list or create a new one.
Examples:
listUpper(list("a", "an", "being")) -> list("A", "AN", "BEING") listUpper(list("every", "gator", "eats")) -> list("EVERY", "GATOR", "EATS") listUpper(list()) -> list()
In this format:
public List
2. Write a method called listSearch() that takes in a target string and a list of other strings. This method returns a (possibly shorter) list containing all of the strings from the original list that themselves contain the target string you are searching for. Check for the target string as a case-sensitive substring of every member of the list. You can either modify the provided list or create a new one.
Examples:
listSearch("a", list("a", "an", "being")) -> list("a", "an") listSearch("ea", list("every", "gator", "eats")) -> list("eats") listSearch("", list("every", "gator", "eats")) -> list("every", "gator", "eats") listSearch("anything", list()) -> list()
In this format:
public List
3. Write a method called listLength() that takes in a list of strings and returns a list of their lengths as integers. You must create a new list for your answer.
Examples:
listLength(list("", "a", "ab", "abc")) -> list(0, 1, 2, 3) listLength(list("hello world")) -> list(11) listLength(list()) -> list()
In this format:
public List
4. Given a string, return a string where every appearance of the lowercase word "is" has been replaced with "is not". The word "is" should not be immediately preceeded or followed by a letter -- so for example the "is" in "this" does not count. (Note: Character.isLetter(char) tests if a char is a letter.)
Examples:
notReplace("is test") -> "is not test" notReplace("is-is") -> "is not-is not" notReplace("This is right") -> "This is not right"
In this format:
public String notReplace(String str) { }
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