aa2 - Problem Set 2 Due: Feb 26 cs2me3 Winter 2007...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Problem Set 2 Due: Feb 26 cs2me3 Winter 2007 Instructions 1. You are encouraged to work in groups of two. If you cannot find a partner, you can work alone. 2. Please submit one copy of the assignment; if you are working with a partner, both names should appear on the assignment. 3. For Part A of the assignment, you must submit an electronic copy of your Java appli- cation via WebCT (by the time of the lecture on the due date of the assignment). Part A A text consists of a sequence of words, W = { w 1 ,w 2 ,. .. ,w n } . We may assume the words are over the ASCII alphabet. Let c i be the number of characters of the word w i , i.e., c i = | w i | . We also have a maximum line length L . We want to write a pretty-printer for text. A formatting of W consists of a partition of the words in W into lines. In the words assigned to a single line, there should be a space after each word except the last; and so if w j ,w j +1 ,. .. ,w k are assigned to one line, then we should have: k- 1 X...
View Full Document

Page1 / 2

aa2 - Problem Set 2 Due: Feb 26 cs2me3 Winter 2007...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online