CSSE 220 -- Object-oriented Software Development

Homework 5 Due at 8:05 AM on Day 6. 
Written problems due at the beginning of your class period.
(Give them to Molly as you come in).

  1. There is no new assigned reading.  If you are behind on the reading, use this time to get caught up.  If you are caught up, use it to rest or to catch up in another class.
  2. Complete the Angel quiz over some previous reading assignments (Sections 4.1-4.1.11) You'll find this on the course Angel page, under Lessons → Assignments → Reading Quizzes → Quiz 4.   
  3. Do the written exercises that are listed below.  You may write them neatly by hand or do them on your computer and print them. Turn in hard copy at the beginning of the Day 6 session. Include your name and section number at the top of your paper. 
  4. Make significant progress (approximately 50%) on the BigRational programming assignment  It will be due at the beginning of session 8, but there also will be some additional work to complete before then.

Written problems

  1. (5 points)  Weiss exercise 2.11.
  2. (5 points)  Weiss exercise 2.12.  You do not have to do this on your computer, but you are welcome to do so if you wish, and paste the code into your document (or just print it if you did the rest of the problems by hand).  You should not use high-level tools like StringTokenizer to do this, but should use the basic String operations (indexOf and substring may be particularly helpful).  The following code and output may help clarify what the method is supposed to do.

    public static void main(String[] args) {
        String[] stringList = split("Here is a short sentence.", " ");
        for (String s : stringList)
           System.
    out.println(s);
        System.
    out.println("-------");
        stringList = split("abracadabra.", "bc");

        for
    (String s : stringList)
           System.
    out.println(s);
    }

  3. (2 points) Weiss exercise 3.12.