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 =
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
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
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
/public class BaseConversions
/Main method: requires nothing because it is being tested by JUnit
/toBase10: takes in a String for input as well as the base (2 or 16) as an int. Outputs an int.
/using if/elseif/if, deter
/ Test the BaseConversions class.
public class BaseConversionsTest extends TestCase
/ * Constructs a BaseConversionsTest with the specified name.
/ * @param name Test case name.
/ public BaseConversion
public class BaseConversions
public void main(String args)
public static int toBase10(String input, int base)
int answer = 0;
int length = input.length();
/find the length of the string (minus one, so that it is t
Greek mythology is made up of myths and legends belonging to the ancient
Greeks. These myths and legends include stories about their gods and heroes, as well as
the nature of the world and the significance of their rituals and
Requirements for TalkBot
1.1 The application should create and realistic conversation between
multiple clients and a server acting as the second person in a
conversation. The conversation should continue fluently until the client
Circuit switching: dedicated path, established before communication begins.
Packet switching: shares a path, not established before communications begins.
Packet Delay: Processing, transmission, propagation, and queuing.
Queuing Delay: packet transmitted,
1.1. Create a realistic AI program that a client can have a conversation with.
1.2. Allow the program to work over a network.
1.2.1. Preferably with multiple clients at once.
1.3. Implement techniques that will co
1. There is no difference between a host and an end system.
2. Wikipedia describes diplomatic protocol as a set of rules and activities or
unwritten guidelines related to the relations between states.
3. A client is an applicatio