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: conditional
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...
Roxy has written a method to count the number of people in her neighborhood, excluding children under 16 and individuals who are only...
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"; }...
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...
For this question you can assume you have access to three jeroo variables. One named tom
, one named steve
, and one named jerry
.
Change if...
For this question you writing code for named erin
. Change the if statement to a while loop so that erin
will continue turning until erin
...
For this question you can assume you have access to three jeroo variables. One named tom
, one named steve
, and one named jerry
.
Add in...
For this question you can assume you have access to one jeroo variable named lakin
. Add in the conditional for the following while loop....
For this question you can assume you have access to one jeroo variable named rose
. Add in the conditional for the following while loop....