Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 listUpper(List 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 listSearch(String target, List 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 listLength(List 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

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_2

Step: 3

blur-text-image_3

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

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students also viewed these Databases questions

Question

8. Explain competency models and the process used to develop them.

Answered: 1 week ago