4.5 Week 5 - Threads 4 Operator Precedence and Associativity4.3 Week 3 - Strings, Comments, & Statements4.4 Week 4 -- Unicode, Floating Point, ...

4.4 Week 4 -- Unicode, Floating Point, ...

4.4.1 Reading and Web Sites

  1. Finish reading van der Linden Chapter 5, Names, Arrays, Operators, and Accuracy
  2. What Every Computer Scientist Should Know About Floating-Point Arithmetic 44 pages, 2 Mbytes.
  3. Start reading van der Linden Chapter 6, More OOP -- Extending Classes

4.4.2 Notes

  1. Unicode - 16 bit characters.
  2. Double and float
  3. Arrays, references, defining van der Linden 109
  4. Cloning van der Linden page 113 Niemeyer & Knudsen page 175
  5. instanceof operator van der Linden page 125

4.4.3 Lab Assignments - Arrays and Objects

  1. Fill a String with a sentence that has at least 6 words.
  2. Using the String.length method, determine the length of the string in characters.
  3. Create a linked list with this many Objects. Each of these Objects will be part of a linked list. So it will need a field for a character (char) and a reference to the same type of object.
  4. Once this is done, print out the sentence, using the required method. See item: 4.4.3.
  5. Instantiate the objects and fill the objects with the characters from the sentence. Use the String.charAt to get the individual characters from the String. While you do this, count the number of "words". "Words" will be indicated by the transition from the beginning of the string to a non-blank, or the transition from a blank to a non-blank.
  6. Create an array of references to your objects with one location for each word.
  7. "Break" your linked list into words, so that each linked list is now null terminated. Place a reference to the start of each word in the array.
  8. Scanning the array backwards, print out the sentence with the words in the reverse order. Use the objects required method. See item: 4.4.3.
  9. In your objects class, include a method for printing out a linked list of characters.
Turn in a copy of your program and an example run.
Instructor: ltaber@pima.edu ** My new Home at GeoApps in Tucson ** The Pima College Site

4.5 Week 5 - Threads 4 Operator Precedence and Associativity4.3 Week 3 - Strings, Comments, & Statements4.4 Week 4 -- Unicode, Floating Point, ...