Using this class definition:
public class node<E> { //... instance variables public node(E d, node<E> n) { this.data = d;...
Using this class definition:
public class node<E> { //... instance variables public node(E d, node<E> n) { this.data = d;...
Complete the while loop so that the variable repetition
keeps track of how many times the first character in word
is repeated in a row at...
Given a current
temperature and the desired minimum
temperature, keep increasing current
by 0.5
degrees until it has either reached or...
Finish the for loop below. This method should return an int
representing the sum of the numbers from 1 to the parameter n
. For example,...
Finish the for loop below. This method should return a string containing the first n
multiples of 3 concatenated together. use a loop...
For this question you will be working with the following two classes:
public class Television { private int currentChannelNumber; public...
For this code, we are adding a method to a class called Rabbit
. Much like Jeroo
s, a Rabbit
has a hop()
method which will cause the rabbit...
For this question, you will be working within the Person
class.
public class Person { public Car car; public Person(Car c) { this.car =...
For this question, you will be working within the Person
class. We will be using the Person
and Car
classes from the previous question...
For this question you will be writing a toString()
method within the following class.
public class Book { private String title; private...
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...
The method below takes a string as a parameter. The string contains a name in the form of "<firstname>,<lastname>". This...
The method below takes an int parameter n
. Implement the methodd so that it returns a string containing the numbers from 1 to n
...
Write a method that will return a string composed of the last n
characters of wholeString
.
For example:
getSuffix("reading", 3)
...Implement the following method so that it returns the index of the last space (" ") in the string.
For example:
Given an integer month_number
, complete the function using a switch statement so that the string month_name
is assigned the name of the...
Complete the function using a switch statement so that the variable am_pm
is assigned the value 'A'
if hour
corresponds with any hour...
For this question, declare a local variable and initialize it by creating a new ArrayList
for holding Pixel
objects (you can name the...
The method below takes in a Pixel object called p
as a parameter. In the body of the method below, declare local variable and create an ...
The method below takes in two parameters: a Pixel
object called p
and a List
called list
. For this method, if the list has less than 20...
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....
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...