This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 15-100 HOMEWORK 6 - FALL 2007Answer the following questions on paper and hand in at the start of class on the due date indicated. 1. Let filescanbe a reference to a Scannerthat reads from a text file. Assume that the text file contains one integer per line, but we do not know how many integers are in the file. Write a Java code fragment that outputs how many positive odd integers there are in the text file. Use the following information for problems 2-5: A date displayer is shown here: It displays the month and day for an upcoming event. The next monthbutton advances the month displayed to the next month, wrapping around back to 1 (for January) if the current month is 12 (for December). The next daybutton advances the day displayed to the next day, wrapping around back to 1 if the current day is 31 (wrapping around will cause the month to change also). It is possible to set this display to a nonexistent date (e.g. February 30). We wish to define a Java class named DateDisplayerto model this simple object. to model this simple object....
View Full Document
This note was uploaded on 01/25/2010 for the course CS 15100 taught by Professor Tom during the Fall '07 term at Carnegie Mellon.
- Fall '07