The method below takes in an List
called list
, and returns the same list. Before the return statement, remove the first item in the list....
Search Results
Searching for: CS1114
Individual Exercises
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...
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...