For this question, take a look at the Ball
class defined below.
public class Ball { private boolean isInflated; public Ball() {...
For this question, take a look at the Ball
class defined below.
public class Ball { private boolean isInflated; public Ball() {...
For this question, you are writing a method for a class Person
with the following constructor (which also shows the field names):
public...
If you are given three sticks, you may or may not be able to arrange them in a triangle.
For any three lengths, there is a simple test to...
A rational number is a number that can be represented as the ratio of two integers. For example, 2/3 is a rational number, and you can...
Write a method called product()
that calculates the product of three integers. Your method will need to be named product
. It will take in...
Write a method called average()
that calculates the average of three numbers. Recall that an average is calculated by adding a group of...
For this question, you will be working with the following two classes
A Weather
class and a Person
class:
public class Weather { private...
For this question, declare and instantiate a new ArrayList (you can name the variable whatever you'd like).
Then, return that ArrayList
The method below takes in a Pixel object called p
as a parameter. In the body of the method below, declare and instantiate an ArrayList...
The method below takes in two parameters: a Pixel object called p
and an ArrayList called arr
. For this method, if the ArrayList has less...
The method below takes in an ArrayList called arr, and returns that ArrayList. Before the return statement, remove the first item in the...
For this question you will be using Pixel objects and one Picture object, as described in Reading Activity 06. The following method uses...
For this question you will be using Pixel objects and one Picture object, as described in Reading Activity 06. In the body of this...
For this question you will be using Pixel objects and one Picture object, as described in Reading Activity 06. In the method below write...
For this question you will be using FoodItem
objects and one GroceryBag
object.
public class FoodItem { private double price; public...
For this question you will be using FoodItem
objects and one GroceryBag
object.
Here's what the FoodItem class looks like:
public class...
The method below takes in an ArrayList called arr
. You can assume this ArrayList will only ever hold integers.
This method needs to...
For this question, assume we have a stack created and stored in the variable s
. This stack supports the usual push()
, pop()
, and clear()
...
For this question, assume we have a stack created and stored in the variable s
. This stack supports the usual push()
, pop()
, and clear()
...
For this question, assume we have a stack created and stored in the variable s
. This stack supports the usual push()
, pop()
, and clear()
...
For this question, assume we have a stack created and stored in the variable s
. This stack supports the usual push()
, pop()
, and clear()
...
Using this class definition:
public class node<E> { //... instance variables public node(E d, node<E> n) { this.data = d;...
For this question you will be using FoodItem
objects and one GroceryBag
object.
public class FoodItem { private int price; private...
For this question you will be using Pixel objects and one Picture object:
Here's what the Pixel class looks like:
public class Pixel {...
Using this class definition:
public class node<E> { //... instance variables public node(E d, node<E> n) { this.data = d;...