HOMEWORK

Mtht 420

Numbered problems (e.g. 1. 1.7) refer to exercises in the text.

Homework is due at the beginning of class one week after it is assigned. Working on homework during class time will have serious negative effects on class participation grades. These assignments are initially based on the MCS294 homeowrk, and are subject to change up until the end of the class period preceeding the due date. The assignments should be posted here in their final form by the Friday preceeding the due date; any last minute emergency instructions will be sent to the mailing list burgiel-mtht420@math.uic.edu.


Week 1
Week 2
Week 3
Week 4
Week 5
Week 6
Week 7
Week 8
Week 9
Week 10
Week 11
Week 12
Week 13

Week 1:

Read sections 1.1-1.16 and the first part of the preface.
  1. 1.7
  2. 1.8
  3. 1.17
  4. Send email to burgiel-mtht420-subscribe@math.uic.edu and follow the forthcoming instructions to subscribe to the Mtht 420 mailing list. The address of this list will be burgiel-mtht420@math.uic.edu; feel free to send questions, comments, and programming-related information to it (no chain letters please.)
  5. Construct an 11 to 22 inch long timeline from the information presented in sections 1.6-1.11. Use the Michigan Electronic Library Computer History web site to fill in missing dates and a few extra facts.
  6. Extra Credit (5 points): Make a poster out of your timeline to be displayed in a UIC classroom or hallway.

Week 2:

Read sections 1.17-2.8 and handout on HTML. (If you can't download this, try the PDF version.)
  1. 2.10
  2. 2.21
  3. Write down a series of if/else statements that describe the decision making process you use to decide what to have for dinner as you leave work. You will probably want to consider variables such as the time of day, the contents of your refrigerator, whether or not your spouse and children will be eating with you, etc. Use parenthesis and indentation to make your answer easier to interpret. For example:
    // Contributed by William Stenzel, 1/28/99
    
    if I take something out of the freezer in the morning
       eat that for dinner
    else
       if Julie has class
          if I go running after work
             eat pasta
          else
             eat leftovers
       else
          if we go to the health club
             eat pasta
          else
             order pizza
    

Week 3:

Finish Chapter 2, read Sections 3.1-3.7.
  1. 3.15
  2. 3.23
  3. List the possible outcomes of your decision of what to have for dinner as you leave work (e.g. pizza, leftovers, roast chicken, spaghetti.) For each outcome, write down a logical statement describing when you choose that outcome. You may abbreviate using Java's logical operators.

    Your solution should look something like:

    • pizza if: (Spouse is away) ^ (family will watch a movie during dinner)
    • leftovers if: (Spouse is away) && (family will watch a movie during dinner)
    • spaghetti if: ((Spouse is home) && (no movie during dinner)) && (!(there's time to roast a chicken))
    • roast chicken if: ((Spouse is home) && (no movie during dinner)) && (there's time to roast a chicken)

  4. Write a program Quiz.java which will ask and get answers to ten randomly generated integer multiplication problems one by one. It should then calculate and output a percentage score. Hand in the code and be prepared to run the program in class at 7PM.

Week 4:

Read Sections 3.9-4.2, 4.4-4.5, 4.11, 4.12.
  1. 4.11 (a,d)
  2. 4.13 (a)
  3. Over the next few weeks we will design a java quiz. Choose a grade level, topic, format (multiple choice, long answer, short answer, or a combiniation) and objective for your quiz. Describe the proposed quiz program in a few paragraphs. Contrast your quiz with a paper-and-pencil quiz and discuss why you designed the quiz as you did.
  4. Write up the top statement and first refinement (as described in Section 2.9) for the quiz described above.

Week 5:

Read the rest of Chapter 4 and study for the Midterm.
  1. 4.7
  2. 4.40
  3. 4.44

Week 6:

Read Sections 5.1-5.9
Extra Credit (5 points): 4.38
  1. 4.40
  2. 5.14
  3. Create, compile, and run a first draft of your quiz program. You should be able to write most of the init() and paint() methods; your scoring and recording methods may be incomplete or nonexistent. You might want to refer back to the rudimentary Java quiz and source code we discussed in class on week 4.

Week 7:

Read Chapter 6
  1. 6.2 (Refer to Rational.java and RationalTest.java)
  2. Post your completed Quiz applet on a web page and turn in the URL. Extra credit will be awarded for use of advanced features such as radio buttons, layout managers, and for especially nice looking quizzes.

Week 8:

Reread Chapter 6, carefully reread the
Rational class and associated test program.
  1. Write a comparison of the iterative and recursive Fibonacci number generating applets. Your answer should include statistics on the numbers of calls to method fibonacci, memory storage allocated for integers, additions, and comparisons performed by each applet for small, medium, and large values of variable number.
  2. Write methods magnitude() and square() to return the magnitude (the square root of the sum of the squares of the real and imaginary parts) and the square of the complex object. Add these to the Complex class you wrote last week. You will (hopefully) use these to write an applet illustrating the Mandelbrot Set when we start chapter 9.

Week 9:

Read Sections 9.1-9.4, 9.6-9.7, 9.12, 9.14.
Extra Credit (up to 3 points) Add colors or resolution to your Mandelbrot set program.
  1. (3 points) Turn in the URL of a working ComplexTest applet which uses your Complex class.
  2. (7 points) Use your Complex class to generate and display a 100x100 array of rectangles where the rectangles are colored black if they lie in the Mandelbrot set and left uncolored or given another color if they don't. The array should display an area with corners at -1-1.5i and 2+1.5i.

Week 10:

Study for the Midterm, start reading Chapter 7
  1. Write one or two pages describing the methods you would expect a class CardCatalogue to have and what they would do. Some examples would be: printout alphabetically by author, search for title, and add card.
  2. 9.24 (If you get stuck, try writing a top down, stepwise refinement for this program.)

Week 11:

Read Chapter 7
  1. Think of an example of a class, subclass, and superclass a Java programmer might use (e.g. Car, MiniVan, and MovingObject.) Describe (in under two pages) the instance variables and methods of the superclass, of the class, and of the subclass.
  2. 7.8 (Explain your answer)
  3. 7.16

Week 12:

Finish Chapter 7, start Chapter 17.
  1. Write a top-down stepwise refinement of the insertion sort algorithm we discussed in class. (Next week you will use this refinement to write a method to perform the insertion sort.)
  2. Write a question that would be appropriate for the final exam for this course and send it via email to burgiel-mtht420@math.uic.edu. (Please indicate in the message that this is an exam question and not one you want me to answer!)

Week 13:

Finish Chapter 17 and prepare for the final exam review session.
  1. Implement (write a method that performs) the insertion sort. Write an applet to demonstrate the performance of this method (it must at least print the unsorted and sorted lists) and turn in the URL of a web page containing the applet. Extra credit will be awarded for allowing the user of the applet to input their own list.
  2. Compare and contrast the basic data structures presented in chapter 17. (Linked lists, stacks, queues, and binary trees.) Your answer should address questions such as whether the structure is linear or not, how items are added to and deleted from the structures, and under what circumstances each structure might be useful.

Mtht 420