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...
Search Results
Searching for: Java
Individual Exercises
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...
The method is given a list of strings called list
and a string value
. Implement it so that it returns the index of the last occurrence of...
Given a Picture object called pic
, use nested for loops and getPixel()
to turn every other row of pixels black. To be clear, after this...
The following method takes in a Picture object pic
as a parameter. This picture will be 500 pixels by 500 pixels.
For this question,...
This method takes a list of strings called list
. Implement it so that it returns the total number of vowels ('a', 'e', 'i', 'o', and 'u')...
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...
Using the Box
class described in the reading assignment, create an instance of Box
that can hold the value 4.2, then return that Box
.
...
Using the Box
class described in the reading assignment, create an instace of Box
that can hold the generic value passed in as a...
The following method takes in a list of objects, but the type of objects are specified by the generic type parameter T
. It also takes a...
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...
The following method takes in a list of generic objects and returns the number of items in the list. As written, however, the method will...
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...
For this question, create an array of Strings of length 10. You do not need to change any values in that array, simply create it and...
The following method takes in an int called size
. For this question, create an array of booleans of length size
. You do not need to...
The following method takes in an int called size
and a double called value
For this question, create an array of doubles of length size
....
The following method takes in an int called size
, a String called value
, and an int index
For this question, create an array of Strings...
The following method takes in an array of integers called numbers
. Implement the method so that it increases the value of each item in...