Complete the function countStrings()
so that it returns the count of Strings in the array names
that are not null
.
Search Results
Searching for: array
Individual Exercises
Complete the function countStrLongerThan()
so that it returns the count of Strings in the array names
that are longer than minLen
. You...
Given an array of int
s, return the smallest value in the array. Assume the array has only posivitive numbers. If the array has no values...
Given an array of Strings, return the longest String in the array. If the array is empty, return null.
Given an array of integers, return the sum of all the values in the array.
Given an array of doubles, return the average of all the values in the array.
Complete the function joinStrings()
so that it returns a string with all the strings in words
concatenated. You should use sep
as a...
Complete the function joinStrings()
so that it returns a string with all the strings in words
concatenated. You may assume that the array...
Given an array of integers, return the first element in the array that is larger than maxVal
. Assume the array has only posivitive...
Given an array of integers numbers
, return the nth
element in the array that is larger than maxVal
. Assume the array has only posivitive...
Given an array of integers numbers
, return a new array with just the values in numbers
that are odd. The new array should just be of the...
Given a size
for an array and the initial
value, create and return a new int
array that is initialized with initial
stored in all the...
For this assignment, create a method that will turn a fixed-size arrayBag into a set.
A Set is an abstract data type somewhat similar...
Write the member method 'playBagBingo()' that implements the player logic for the game described below. Bag Bingo is a game of chance...
Write a method that reverses the contents of the given string array contents
returning an ArrayList<String>
with the resutts. If...
Complete the function getElementAt()
so that it returns the element nth
in the ArrayList contents
. Make sure that the parameter nth
is a...
Complete the function countStrLongerThan()
so that it returns the count of Strings in the ArrayList<String> names
that are longer...
Complete the function removeStrLongerThan()
so that it removes from strings in the ArrayList<String> names
that are longer than ...
Given an integer called value
and an array of three integers called list
, the boolean found
should be true
if value
is is within list
one...
We want to count how many times we walked the family dog in a week. Provided an array of seven integers, representing how many times the...
For the question below, assume the following implementation of the Ball class
public class Ball{ private String color; private double...
For this question, assume the following implementation of the class Person and the following UML diagram
Person Class Implementation
...
For this question, assume the following implementation of the class Person and the following UML diagram
Person Class Implementation
...
For this question, assume the following implementation of the Person and Student classes:
Person Class Implementation
public class Person...
For the question below, assume the following implementation of the Measurable interface and Square and Circle classes:
public interface ...