Parenthesized notation
A binary tree can be represented in parenthesized notation. The image below shows an example of how to represent...
Searching for: Java
A binary tree can be represented in parenthesized notation. The image below shows an example of how to represent...
Convert the linear search given below to use a Comparable. The documentation for the interface Comparable can be found online.
You don't...
Welcome to CodeWorkout! You can edit the Java code below. The 'check my answer' button attempts to compile your Java code, and if it...
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 a function in Java that calculates a total cost with tax and tip. Given three doubles: basePrice, taxRate (as a decimal, e.g., 0.08...
Write a function in Java that calculates what grade a student needs on the next quiz to reach a target average. Given three ints:...
Write a function in Java that calculates the average speed of a trip. Given four ints: distance (miles), days, hours, and minutes;
...
Write a function in Java that calculates the difference between the volumes of two cubes. Given two doubles: sideLength1 and sideLength2...
Write a method that takes a quote and its author as two separate strings, and returns a single string formatted in this style:
"The only...
Write a recursive method int countDigits(int n) that returns how many digits are in n. The key idea on recursion in this...
In English, there are some mechanical rules to turn a singular noun to plural. For this exercise, complete the method String...
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...