A Jeroo named pat is hosting a party for the other jeroos on the island. A jeroo party will be a huge success when the number of flowers...
Search Results
Searching for: conditional
Individual Exercises
Implement the following method so that it returns the index of the last space (" ") in the string.
For example:
- If we call this method...
Say that a "character clump" in a string is a series of 2 or more adjacent copies of the same character. Return the number of character...
Implement the following method so that it counts the number of times the target character appears in the given string and returns the...
Write a function in Python that implements the following logic: Given 2 int values a and b greater than 0, return whichever value is...
Write a function in Python that implements the following logic: The squirrels in Palo Alto spend most of the day playing. In particular,...
You have a green lottery ticket with three integers: a, b, and c. If all of the numbers are different on it, return 0. If two of the...
You have a green lottery ticket with three integers: a, b, and c. If all of the numbers are different on it, return 0. If two of the...
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 the method boolean areAllPositive(int[] nums) in Java that returns true if all elements in the array nums are positive (greater...
Write the method boolean areAllNegative(int[] nums) in Java that returns true if all elements in the array nums are negative (less than...
Write the method boolean areAllEven(int[] nums) in Java that returns true if all elements in the array nums are even numbers, and returns...
Write the method boolean areAllOdd(int[] nums) in Java that returns true if all elements in the array nums are odd numbers, and returns...
Write the method boolean areAllGreaterThan(int[] nums, int x) in Java that returns true if all elements in the array nums are greater...
Write the method boolean areAllLessThan(int[] nums, int x) in Java that returns true if all elements in the array nums are less than the...
Write the method int sumAllPositives(int[] nums) in Java that returns the sum of all elements in the array nums that are positive.
Write the method int sumBeforeNegative(int[] nums) in Java that returns the sum of the elements in the array nums up till the first...
Write the method int sumAfterNegative(int[] nums) in Java that returns the sum of the elements in the array nums after the first negative...
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",...
Write the method boolean containsRoot(String word) in Java that returns true if the string in word contains inside (see below) one of...