The method below should take in a string as a parameter and return an int representing the number of lower case 'a's there are in the...
Search Results
Searching for: enhanced for loop
Individual Exercises
The method below takes an int parameter n
. Implement the methodd so that it returns a string containing the numbers from 1 to n
...
Implement the following method so that it returns the index of the last space (" ") in the string.
For example:
- If we call this method...
For this question you will be working with a Picture
object, but you may not call getPixels()
for your loop. Instead, you will need to...
The method below takes a String
parameter called str
. Complete the method so that it returns a new string where each each character in...
The following method takes a list of strings as a parameter and returns the number of times the character 'e' appears in all of the...
The method below takes in a List
called list
. You can assume this list only holds integer values. Implement the method so that it returns...
This method below currently sets the color of all of the pixels in the given Picture
to black. Modify the appropriate loop so that...
For this question, a list of integers called list
is passed in as a parameter. Implement this method so that it creates an returns a new...
Complete the function that takes two unsigned integers and calculates the exponentiation of base
raised to the power of power
and returns...
Complete the function that receives an unsigned integer and creates a string that repeats a laugh as many times as specified by the...
Implement the following method that takes a Picture
object called pic
so that it turns the bottom half of the image white. Do this using...
For this question, you will be using the Book
and Shelf
classes from the reading assignment.
Sometimes, a library will get multiple...
For this question, you will be using the Book
and Shelf
classes described in the reading assignment.
Implement the following method so...
For this question, you will be using the Book
and Shelf
classes described in the reading assignment.
Implement the following method so...
The following method takes in a ist of integers and a value
representing some number appearing in the list, perhaps multiple times.
Using...
The following method takes in a list of strings and a string value
. Implement the method so that it will return the index of the second...
The following method takes in a List of generic parameter type T
and a value of the same type. This method should return true
if there...
public class Person { private String name; public Person(String na) { this.name = na; } public String getName() { return name; } }
The...
The following question makes use of the generic Box
class discussed in the reading assignment.
public static class Box<T> { private...
The following method takes in an array of integers called numbers
. Implement the method so that it increases the value of each item in...
The following method should return the index of the specified value
within the integer array numbers
. However, it does not work properly....
Say that a "character clump" in a string is a series of 2 or more adjacent copies of the same character. Return the number of character...
Fill in the for loops in the following method. This method needs to iterate through the 2D boolean array and set each slot in the array...
Implement the following method so that it counts the number of times the target
character appears in the given string and returns the...