What value is stored in myDouble
after casting happens during the assignment in the second line of code?
int myInt = 9; double myDouble =...
Score: 0 / 14.0
Exercises to review Java Knowledge.
What value is stored in myDouble
after casting happens during the assignment in the second line of code?
int myInt = 9; double myDouble =...
Given an array containing three ints, return the sum of all the elements. It is safe to assume that the array always has at least 3...
Write a function first10(s)
that returns the first 10 characters of s
. If s
is longer than 10 characters, just truncate it. If s
is...
Write a function toTitleCase(s)
that returns the s
converted to Title Case. Title case has each word in the s
with its first letter in...
Write a function fullWords(s)
that returns a string no longer than 20 characters. If the string s
is longer than 20 characters, just...
Given an array of integers, return the largest value in the array. Assume the array has only posivitive numbers. If the array is empty,...
Complete the function getArraySize()
so that it returns the size of the array passed in as an argument into the function. You cannot use...
Complete the function getElementAt()
so that it returns the element stored at the nth
position in the array numbers
. You may assume that...
Rewrite the function getElementAt()
so that it returns the element nth
in the array numbers
, but only if there is an element at that...
Complete the function countStrLongerThan()
so that it returns the count of Strings in the array names
that are longer than minLen
. You...
Complete the function countStrings()
so that it returns the count of Strings in the array names
that are not null
.
Complete the function countStrLongerThan()
so that it returns the count of Strings in the array names
that are longer than minLen
. You...
Write a function called repeat(s, n)
with two parameters, a String s
and an int n
. The routine should return a string with s
repated n
...
Given an array of Strings, return the longest String in the array. If the array is empty, return null.