Given two strings of equal length, return an array of char
values that contains the characters of the strings in alternating order. For...
Search Results
Searching for: condition
Individual Exercises
Given an int[] nums
array, return the sum of the first five elements from the array. Note that nums
could have fewer than five elements,...
Create an enhanced for loop that iterates to each String in the array words
and returns true when there is at least one String with more...
Write a function findEvenQueue
that returns the first even number in the Queue. The function looks at the value at the front of the queue...
Return the index of first four in an array. Return -1 if there are none.
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...
Roxy has written a method to count the number of people in her neighborhood, excluding children under 16 and individuals who are only...
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)...
A local grocery store has asked you to design a method to verify if their produce is okay to put on the shelves. The method takes an...
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",...
This method returns the value of the minimum element in the subsection of the array "y", starting at position "first" and ending at...
Based on three scores that the user inputs, display the average of the scores and the letter grade that is assigned fort he test score...
A magic date is one when written in the following format, the month times the date equals the year e.g. 6/10/60. Write code that figures...
Wilson’s Shipping Company charges the following rates:
Weight of Package
Rate per 500 Miles Shipped
2 pounds or less
$1.10
Over 2 lbs...
Replace the /* comparison */ comment with the appropriate expression that evaluates whether the variable first
is the same size or bigger...
Replace the /* comparison */ comment with the appropriate expression that evaluates whether the variable initial is either a lowercase or...
Complete the code so that it checks if the variable letter is a lowercase vowel (a, e, i, o, or u) and assigns true or false to the...
Complete the code so that the variable polarity is -1 when adding first and second is negative, but polarity is 1 when adding first and...
Given three variables called first, second and third. If third is less than the difference of first and second, then return third....
Given three integer variables called first, second and third, if second is less than first, return false. Otherwise, check if third lies...
Add a new else if statement to the conditional below. if the jeroo named charles
sees a net ahead if it, it should run the toss method.
For this question, you have access to a Jeroo named amy
. Add in an else statement to the following cascaded if that will set the int...
For this question you can assume you have access to two jeroo variables. One named tom
and one named jerry
.
Change the if statement so...