The method mapNums returns a HashMap that stores values of how many times a given key digit has appeared in an input String. Write a...
Search Results
Individual Exercises
Roxy has written a method to count the number of people in her neighborhood, excluding children under 16 and individuals who are only...
Mars' new colony needs your help. This morning, a flurry of distress signals reached Earth, each encrypted with a secret message....
Complete the hashing algorithm for a hash table so that it functions using open addressing. Remember to store both keys and values in...
In mathematics, the Perrin Numbers are defined by the recursion relation
P(n) = P(n - 2) + P(n -3) for n > 2
with initial values
P(0)...
Given a string str
and an int n
, return a string made of the first n
characters of the string, followed by the first n - 1
characters of...
[Based on an exercise at https://codeworkout.cs.vt.edu/]
Given an array of Strings, return a single String that is made up of all strings...
The method wabbajack()
is defined as follows:
public String wabbajack(String input) { if (input.length() < 5) { return "Rabbit"; }...
A string is a palindrome if it reads the same forward and backward, with case insensitivity. For example, the words "mom", "dad", "Mom",...
Write a function that returns true if a
is even, false otherwise. Just for practice, you must use an if
statement.
This method takes an integer array as a parameter and returns true if the array includes an odd integer; otherwise, the method returns...
This method accepts two integer arrays as its parameters and returns a new array, which contains all of the elements of first parameter...
Complete this method so it prints out the difference between the two parameters.
This method takes a String object as a parameter and returns a compressed version of the object. The method compresses the String by...
This methods takes a String object as a parameter and returns an encrypted version of the object. The encryption is done in two steps:...
This method simulates flipping a fair coin. It takes an integer parameter, which specifies the number of times that the coin is to be...
This method simulates flipping a fair coin. The coin is flipped repeatedly until three consecutive heads are seen. The method takes an...
This method simulates flipping a fair coin. The coin is flipped repeatedly until three heads are seen. The method takes an integer...
This method takes an ArrayList of Strings as a parameter and returns the longest String in the list. If the list is empty, it should...
This method takes an ArrayList of Strings as a parameter and returns the length of the longest String in the list. If the list is empty,...
This method takes an ArrayList of integers as a parameter and does not return anything. The method will expand the list with a mirrored...
This method takes an ArrayList of integers as a parameter and does not return anything. The method will remove all of the odd elements in...
This method takes an ArrayList of integers as a parameter and does not return anything. The method will repeat each odd element in the...
This method returns the value of the minimum element in the subsection of the array "y", starting at position "first" and ending at...
Fill in the correct access modifier to make this method only accessible by the class it is in. Return the correct boolean that indicates...