Problem 1RE Problem 2RE Problem 3RE: Write a program that contains a bounds error. Run the program. What happens on your computer?
Problem 4RE: Write a loop that reads ten numbers and a second loop that displays them in the opposite order from... Problem 5RE Problem 6RE: Consider the following array:
int[] a = { 1, 2, 3, 4, 5, 4, 3, 2, 1, 0 };
What is the value of total... Problem 7RE: Consider the following array:
int[] a = { 1, 2, 3, 4, 5, 4, 3, 2, 1, 0 };
What are the contents of... Problem 8RE Problem 9RE: Write Java code for a loop that simultaneously computes both the maximum and minimum of an array.
Problem 10RE: What is wrong with each of the following code segments?
int[] values = new int[10];
for (int i = 1;... Problem 11RE: Write enhanced for loops for the following tasks.
Printing all elements of an array in a single row,... Problem 12RE: Rewrite the following loops without using the enhanced for loop construct. Here, values is an array... Problem 13RE: Rewrite the following loops using the enhanced for loop construct. Here, values is an array of... Problem 14RE: What is wrong with each of the following code segments?
ArrayList<int> values = new... Problem 15RE: For the operations on partially filled arrays below, provide the header of a method. Do not... Problem 16RE: Trace the flow of the loop in Section 7.3.4 with the given example. Show two columns, one with the... Problem 17RE Problem 18RE Problem 19RE: Trace the algorithm for removing an element described in Section 7.3.6. Use an array values with... Problem 20RE: Give pseudocode for an algorithm that rotates the elements of an array by one position, moving the... Problem 21RE Problem 22RE: Suppose values is a sorted array of integers. Give pseudocode that describes how a new value can be... Problem 23RE: A run is a sequence of adjacent repeated values. Give pseudocode for computing the length of the... Problem 24RE: What is wrong with the following method that aims to fill an array with random numbers?
public void... Problem 25RE: You are given two arrays denoting x- and y-coordinates of a set of points in a plane. For plotting... Problem 26RE: Solve the quiz score problem described in Section 7.4 by sorting the array first. How do you need to... Problem 27RE Problem 28RE: Develop an algorithm for finding the most frequently occurring value in an array of numbers. Use a... Problem 29RE: Write Java statements for performing the following tasks with an array declared as
int[][] values =... Problem 30RE Problem 31RE: Section 7.7.7 shows that you must be careful about updating the index value when you remove elements... Problem 32RE: True or false?
All elements of an array are of the same type.
Arrays cannot contain strings as... Problem 33RE: How do you perform the following tasks with array lists in Java?
Test that two array lists contain... Problem 34RE Problem 35RE Problem 36RE Problem 1PE: Write a program that initializes an array with ten random integers and then prints four lines of... Problem 2PE: Modify the LargestInArray.java program in Section 7.3 to mark both the smallest and the largest... Problem 3PE: Write a method sumWithoutSmallest that computes the sum of an array of values, except for the... Problem 4PE: Add a method removeMin to the Student class of Section 7.4 that removes the minimum score without... Problem 5PE Problem 6PE: Write a method that reverses the sequence of elements in an array. For example, if you call the... Problem 7PE: Write a program that produces ten random permutations of the numbers 1 to 10. To generate a random... Problem 8PE: Write a method that implements the algorithm developed in Section 7.5.
Problem 9PE Problem 10PE Problem 11PE: Consider the following class:
public class Sequence
{
private int[] values;
public Sequence(int... Problem 12PE: Add a method
public boolean sameValues(Sequence other)
to the Sequence class of Exercise E7.11 that... Problem 13PE: Add a method
public boolean sameValues(Sequence other)
to the Sequence class of Exercise E7.11 that... Problem 14PE Problem 15PE Problem 16PE: Add a method to the Table class below that computes the average of the neighbors of a table element... Problem 17PE: Given the Table class of Exercise E7.16, add a method that returns the sum of the ith row (if... Problem 18PE Problem 19PE Problem 20PE Problem 21PE: Improve the program of Exercise E7.17 by adding captions for each bar. Prompt the user for the... Problem 22PE: Consider the following class:
public class Sequence
{
private ArrayList<Integer> values;
public... Problem 23PE Problem 24PE Problem 1PP Problem 2PP Problem 3PP Problem 4PP Problem 5PP Problem 6PP Problem 7PP Problem 8PP Problem 9PP Problem 10PP Problem 11PP: A pet shop wants to give a discount to its clients if they buy one or more pets and at least five... Problem 12PP Problem 13PP Problem 14PP Problem 15PP Problem 16PP Problem 17PP Problem 18PP Problem 19PP Problem 20PP Problem 21PP Problem 22PP Problem 23PP Problem 24PP Problem 25PP format_list_bulleted