The method below takes in a set of String names of students. Below, use this set names to create a map (either HashMap or TreeMap is...
Search Results
Searching for: String
Individual Exercises
Complete the calculatePrice function so that each item in the provided cart added to the total price. Any item that is "milk" costs $2.50...
Complete the following function. When given aString, return True if it ends in "ly". Return False otherwise.
Complete the following function. Given aString, return the first half of characters in that string (the string "woohoo" yields "woo")....
Complete the following function. Given aString, return a copy of aString where any character next to a star (*) and all stars themselves...
Given an outside string of length 4, such as "(())", and an inside string, return a new string where the inside is squeezed in the middle...
Complete the following linear search method. Find the string search in the array words. If the string is found, return the index for the...
Write a method replaceSpaceUnderscore that replaces all spaces with _ (underscores) in the String sentence.
Complete the method countTimesContains that returns the number of times the array words contains the word stored in searchW. Remember to...
Complete the following linear search method. Find the string search in the array words. If the string is found, return the string found....
Write a function in Java that implements the following logic: Given a string, return true if it ends in "ly".
Note that you are NOT...
Write a method that takes a quote and its author as two separate strings, and returns a single string formatted in this style:
"The only...
Description
In English, there are some mechanical rules to turn a singular noun to plural. For this exercise, complete the method String...
Write the method String convertName(String name) in Java that implements the following logic: Given a string in the form of "last_name,...
Write the method String convertDate(String name) in Java that implements the following logic: Given a data in string format in the form...
Write the method String convertTime(String time) in Java that implements the following logic: Given a time in 24hr format, often refered...
Write the method String convertPhone(String number) in Java that implements the following logic: Given a phone number as a string of...
Write the method boolean hasPrefix(String word) in Java that returns true if the string in word begins with one of these prefixes:
"pre",...
Write the method boolean hasSuffix(String word) in Java that returns true if the string in word ends with one of these suffixes:
"er",...
For this question assume the following code:
public class LinkedBag<T> implements BagInterface<T>{ private Node firstNode; ...
For the question below, assume the following implementation of LinkedStack:
public class LinkedStack<T> implements StackInterface...
Write a function called count that receives (A) a string and (B) a character, and returns a count of how many times the character is...
Write a function called countVowels that receives a string and returns the count of how many vowels it has, including a,e,i,o, and u and...
For this question, assume the following implementation of the class Person and the following UML diagram
Person Class Implementation
...
The following method should return a string representation of the array in the parameter called numbers. However, currently it returns a...