Complete the method below for evaluating the substring of any string. If the given string is empty, return "Empty". If the parameters are...
Search Results
Searching for: Java
Individual Exercises
[Based on an exercise at https://codeworkout.cs.vt.edu/]
Write a function in Java that takes an int
array as its parameter. It should...
[Based on an exercise at https://codeworkout.cs.vt.edu/]
Given an array containing three ints, return the sum of all the elements.
[Based on an exercise at https://codeworkout.cs.vt.edu/]
Write a function in Java that implements the following logic: Given a string,...
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 an exercise at https://codeworkout.cs.vt.edu/]
Write a function in Java that returns a version of the given array where all the...
Write a recursive function int countBTleaves(BinNode root)
to count the number of leaf nodes in the binary tree pointed at by root
. You...
A string is a palindrome if it reads the same forward and backward, with case insensitivity. For example, the words "mom", "dad", "Mom",...
Write a function that returns true if a
is even, false otherwise. Just for practice, you must use an if
statement.
This method takes an array of integers as its parameters and returns nothing. The method moves each element in the array to the right by...
This method takes an array of integers as a parameter. It returns true if the elements in the array are unique, false otherwise. For...
Complete this method to return the two String parameters combined (concatenated) together.
Write a Java statement to declare an integer variable with the name hours
that has an initial value of 7.
Complete this method to print out the parameter.
Complete this method to produce the following output:
Every java programmer must understand the difference between a System.out.print...
Complete this method to print the two String parameters combined (concatenated) together.
Complete this method to return the parameter received.
This method takes an integer array as a parameter and returns true if the array includes an odd integer; otherwise, the method returns...
This method accepts two integer arrays as its parameters and returns a new array, which contains all of the elements of first parameter...
This method takes an integer array as a parameter and returns the minimum difference between adjacent values in the array. The difference...
Complete this method to return the sum of the two parameters.
Create a print line that sums variable a and variable b.
create a print line that will cast integer division m as an double.
Complete this method so it prints out the remainder of the two parameters.