Description
Write a recursive method int sumDigits(int n) that returns the sum of all the digits in n. The key idea over recursion in...
Write a recursive method int sumDigits(int n) that returns the sum of all the digits in n. The key idea over recursion in...
Given an int array nums of any length, return a new array of its first n elements. If the array is smaller than length n, use whatever...
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...
Given a string, compute recursively a new string where all spaces in the original one are replaced by an underscore (_).
So...
Given a string, compute recursively a new string where all the adjacent chars are now separated by an underscore ("_"). So...
Given a string, compute recursively a new string where a space is removed and the next letter is converted to uppercase.
So given "Hello...
Given a string, compute recursively a new string where uppercase letters in the original one are preceeded with a space in the new...
Given a string, compute recursively a new string where all vowels in the original string will now be in upper case in the new...
Write a recursive Java method that removes adjacent duplicate characters from a String. If two identical characters appear...
In mathematics, the Pell Numbers follow a familiar recursive structure:
P(n) = 2 * P(n - 1) + P(n - 2) for n > 2
with...