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: loop
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...
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...
Write a program that prompts the user:
"How many degrees is it inside today? "
and then starting at that number entered, displays the...
Complete a program to encourage the user to do their chores before going to sleep. Begin by prompting the user Did you clean your room?...
Create a program that asks the user "In one word, how do you feel?\n"
and then gathers the user's response.
When the user enters either ...
Complete a program to simulate an echo. It should display "Hello! \n"
five times, but using only a single cout
statement with a for loop....
Complete a program to enter and show a list of exercises.
Prompt the user with "Hello! what is your workout schedule? (say 'done' to end...
Complete the method countTimesContains
that returns the number of times the array words
contains the word stored in searchW
. Remember to...