This method simulates flipping a fair coin. The coin is flipped repeatedly until three consecutive heads are seen. The method takes an...
Search Results
Searching for: coding
Individual Exercises
This method simulates flipping a fair coin. The coin is flipped repeatedly until three heads are seen. The method takes an integer...
this method accepts a String object as a parameter. It returns true if the String has all unique characters, false otherwise. For...
declare a variable with the appropriate data type to have a statement that says: “Good Morning.” Use the variable you created in the...
This method returns the price of bread. Declare a variable called “price of bread” using camel case and the correct data type in the...
This method takes an ArrayList of Strings as a parameter and returns the longest String in the list. If the list is empty, it should...
This method takes an ArrayList of Strings as a parameter and returns the length of the longest String in the list. If the list is empty,...
This method takes an ArrayList of integers as a parameter and does not return anything. The method will expand the list with a mirrored...
This method takes an ArrayList of integers as a parameter and does not return anything. The method will remove all of the odd elements in...
This method takes an ArrayList of integers as a parameter and does not return anything. The method will repeat each odd element in the...
Write a function in Java called factorial(int n)
that will take a positive integer as input and returns its factorial as output. Your...
Write a function in Java called factorial(int n)
that will take a positive integer as input and returns its factorial as output. Your...
Write a function in Java called factorial(int n)
that will take a positive integer as input and returns its factorial as output. You will...
Fill in the correct access modifier to make this method only accessible by the class it is in. Return the correct boolean that indicates...
Based on three scores that the user inputs, display the average of the scores and the letter grade that is assigned fort he test score...
A magic date is one when written in the following format, the month times the date equals the year e.g. 6/10/60. Write code that figures...
Wilson’s Shipping Company charges the following rates:
Weight of Package
Rate per 500 Miles Shipped
2 pounds or less
$1.10
Over 2 lbs...
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 countNegatives()
so that it counts of negative values in the array numbers
. You may assume that the array has some...
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...
Declare a String variable, name it student
and assign it the value "Malcolm".