Chapter 6 Exercises: 6.7, 6.13, 6.14, 6.15, 6.18.
6.7 What is the value of x after each of the following statements is executed?
a) x = Math.abs(7.5);
absolute value = 7.5
b) x = Math.floor(7.5);
largest integer 7.0
c) x = Math.abs(0.0);
absolute value =
21.6 (Concatenating Lists) Write a program that concatenates two linked list objects of characters. Class ListConcatenate should include a static method concatenate that takes references to
both list objects as arguments and concatenates the second list t
public class Solution cfw_
/start java application
public static void main( String args ) cfw_
/ establish Scanner and command input link
Scanner input = new Scanner( System.in );
int number1; / first number
7.9 Consider a two-by-three integer array t.
a) Write a statement that declares and creates t.
int t  =new int  ;
b) How many rows does t have?
The first set of brackets indicate rows so there are 2 rows
c) How many columns does t have?
What does the following code do?
public int mystery(int a, int b)
if (b = 1)
return a + mystery(a, b - 1);
The code is written as a return equivalent for a X b
18.9 (Recursive power Method) Write a recursive method power(base, ex
4.14 What is the difference between preincrementing and postincrementing a variable?
The difference between preincrementing and postincrementing is indicated by the location of the
variable in reference to pre or postincrimination (decrement). In example,
5.9 Find and correct the error(s) in each of the following segments of code:
a) For (i = 100, i >= 1, i+)
incorrect statement set up for looping, use of commas will result in error, and + is used for
incrementing (should be for decr