{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman{\*\falt Thorndale};}{\f1\froman\fprq2\fcharset0 Times New Roman{\*\falt Thorndale};}{\f2\fmodern\fprq1\fcharset0 Courier New;}{\f3\froman\fprq2\fcharset0 Times New Roman;}{\f4\fswiss\fprq2\fcharset0 Arial;}{\f5\fnil\fprq2\fcharset0 HG Mincho Light J;}{\f6\fnil\fprq2\fcharset0 Arial Unicode MS;}}
{\colortbl;\red0\green0\blue0;\red0\green0\blue128;\red128\green128\blue128;}
{\stylesheet{\s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\snext1 Default;}
{\s2\sa120\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext2 Text body;}
{\s3\sb240\sa120\keepn\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs28\lang1033\sbasedon1\snext2 Heading;}
{\s4\sb240\sa60\keepn\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs28\lang1033\b\sbasedon1\snext1{\*\soutlvl0} Heading 1;}
{\s5\sb240\sa60\keepn\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs24\lang1033\i\b\sbasedon1\snext1{\*\soutlvl1} Heading 2;}
{\s6\sb240\sa60\keepn\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs24\lang1033\sbasedon1\snext1{\*\soutlvl2} Heading 3;}
{\s7\sb240\sa60\keepn\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs24\lang1033\b\sbasedon1\snext1{\*\soutlvl3} Heading 4;}
{\s8\sb240\sa60\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs22\lang1033\sbasedon1\snext1{\*\soutlvl4} Heading 5;}
{\s9\sb240\sa60\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs22\lang1033\i\sbasedon1\snext1{\*\soutlvl5} Heading 6;}
{\s10\li360\ri0\fi-360\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext10 List;}
{\s11\li720\ri0\fi-360\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext11 List 2;}
{\s12\li1080\ri0\fi-360\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext12 List 3;}
{\s13\cf1{\*\tlswg8236}\tqc\tx4320{\*\tlswg8236}\tqr\tx8640{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext13 Header;}
{\s14\cf1{\*\tlswg8236}\tqc\tx4320{\*\tlswg8236}\tqr\tx8640{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext14 Footer;}
{\s15\sb240\sa60\cf1\qc{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs32\lang1033\b\sbasedon1\snext16 Title;}
{\s16\sa60\cf1\qc{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f4\fs24\lang1033\sbasedon1\snext2 Subtitle;}
{\s17\li360\ri0\fi1\sa120\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext17 WW-List Continue;}
{\s18\li360\ri0\fi1\sa120\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext18 WW-Body Text 2;}
{\s19\li360\ri0\fi1\sa120\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon18\snext19 WW-Body Text 3;}
{\s20\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon1\snext20 Normal;}
{\s21\li720\ri0\fi0\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\sbasedon20\snext21 Body Text 2;}
{\*\cs23\cf1{\*\updnprop5801}\up10\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\fs24\lang1033\sbasedon26 Footnote Characters;}
{\*\cs24\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\fs24\lang1033 Page Number;}
{\*\cs25\cf2\ul\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\fs24\lang1033 Internet Link;}
{\*\cs26\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\fs24\lang1033 WW-Absatz-Standardschriftart;}
{\*\cs27\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\lang1033 WW-Absatz-Standardschriftart1;}
{\*\cs28\cf1{\*\updnprop5801}\up10\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\lang1033\sbasedon27 WW-Footnote Symbol;}
{\*\cs29\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\lang1033 WW-Default Paragraph Font;}
{\*\cs30\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\lang1033 WW-Page Number;}
{\*\cs31\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\lang1033\sbasedon29 WW-Page Number1;}
{\*\cs32\cf1\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f0\lang1033\b\sbasedon29 WW-Strong;}
}
{\info{\title 132hw02 - s03}{\author Sharon Tuttle}{\creatim\yr2001\mo1\dy23\hr10\min30}{\operator Sharon Tuttle}{\revtim\yr2003\mo2\dy4\hr10\min58}{\printim\yr2003\mo1\dy28\hr11\min42}{\comment StarWriter}{\vern6410}}\deftab720
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn720\margbsxn720\headery0{\*\headeryb283\headerxl0\headerxr0\headeryh0}{\header \pard\plain \s13\cf1{\*\tlswg8236}\tqc\tx4320{\*\tlswg8236}\tqr\tx8640{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs12 {\ltrch\loch\f3 CIS 132 - HW #2\tab \tab p. {\field{\*\fldinst \\page}{\fldrslt 3}}}
\par {\ltrch\loch\f3 Spring 2003}
\par }
\pgdscnxt0 Default;}}
\paperh15840\paperw12240\margl1440\margr1440\margt720\margb720\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1440\margrsxn1440\margtsxn1303\margbsxn720\headery720{\header \pard\plain \s13\cf1{\*\tlswg8236}\tqc\tx4320{\*\tlswg8236}\tqr\tx8640{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs12 {\ltrch\loch\f3 CIS 132 - HW #2\tab \tab p. {\field{\*\fldinst \\page}{\fldrslt 3}}}
\par {\ltrch\loch\f3 Spring 2003}
\par }
\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\qc{\*\tlswg8236}\tx6300\ltrch\loch\fs24\b {\ltrch\loch\f3 HUMBOLDT STATE UNIVERSITY}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\qc\ltrch\loch\fs24\b {\ltrch\loch\f3 CIS 132 - Introduction to Computer Science II - Spring 2003}
\par {\ltrch\loch\f3 Homework #2 - due Tuesday, February 11th,  beginning of class}
\par {\ltrch\loch\f3 Simple Classes}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033{\*\tlswg8236}\tx1260\ltrch\loch\fs24\b 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24 {\ltrch\loch\f3 (adapted from Northeastern University's }
\par {\ltrch\loch\f3 Winter 2003: COM 1101 Algorithms and Data Structures 1,}
\par {\ltrch\loch\f3 taught by Viera K. Proulx, and assignment set by Viera K. Proulx and Matthias Felleisen)}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\b 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\li0\ri0\fi15\ltrch\loch\fs24 {\ltrch\loch\f3 Since this homework will result in {\b 17} files (!), and I am still investigating if I can provide instructions for you to create .zip files of the files involved in each homework assignment, it would be excessive to have you each send me 17 e-mails (or even 1
7 attachments to a single e-mail). We'll have to go with 3.5" disks or zip disks on this one. Turn in such a disk with your name on it, and with all of your HW #2 files within a directory named {\b 132hw02} on that disk.}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\b 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\li420\ri0\fi-450\ltrch\loch\fs24 {\ltrch\loch\f3 Tips to note:}
\par {\ltrch\loch\f3 *\tab remember to make sure that {\b jpt.jar} and {\b Base.jar} are included in the BlueJ User Libraries!}
\par 
\par {\ltrch\loch\f3 *\tab Examples of user-defined classes and their corresponding test classes can be found on the course web page.}
\par 
\par {\ltrch\loch\f3 *\tab You can print the contents of the Text Console provided by jpt.jar/Base.jar by using the {\b Save contents} command under the {\b File} menu of the Text Console.}
\par 
\par {\ltrch\loch\f3 *\tab If you "lose" the Text Console, so far I simply save everything and restart BlueJ. I suspect there is another way to get it back, so please let me know if you discover it.}
\par 
\par {\ltrch\loch\f3 *\tab It is probably easiest, at this point, to keep all of the classes for a particular homework within a single BlueJ project. (We'll have to organize them differently later, but for now, it should be fine. Plus, some of these need to be in the same project.
..)}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\li420\ri0\fi-450\ltrch\loch\fs24\b 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\li420\ri0\fi-450\ltrch\loch\fs24{\ltrch\loch\f3{\b Exercise 2.1} A class to represent information about one person. }
\par 
\par {\ltrch\loch\f3 *\tab Define the member data for the class {\b Person} that will include the date of birth (year only). Do not use more than seven attributes. (This is not the same {\b Person}{\b0  as in the in-lecture example... 8-) )}}
\par 
\par {\ltrch\loch\f3 *\tab Define the constructor and the {\b toString()} method for the class Person.}
\par 
\par {\ltrch\loch\f3 *\tab Define appropriate accessor methods for your class Person.}
\par 
\par {\ltrch\loch\f3 *\tab Develop the purpose and the contract (header) for at least three methods for the Class Person. (note that you are not actually writing the body of these methods --- just their purpose and contract/header)}
\par 
\par {\ltrch\loch\f3 *\tab Develop the method {\b isOlderThan()} that determines whether this person is older than a given age.}
\par 
\par {\ltrch\loch\f3 *\tab Write a test class for Person, being sure to test your constructor and accessor functions, and {\b isOlderThan()}{\b0 . (Use the in-lecture examples as templates for how to do this.)}}
\par 
\par {\ltrch\loch\f3 *\tab Turn in your resulting {\b Person.java}, {\b PersonTest.java}, and the saved console contents from running the test methods within class {\b PersonTest}.}
\par 
\par {\ltrch\loch\f3{\b Exercise 2.2} A class that represents weather data for one day. }
\par 
\par {\ltrch\loch\f3 *\tab See the links from the course web page for classes {\b WeatherData.java} and {\b WeatherDataTest.java}.}
\par 
\par {\ltrch\loch\f3 *\tab Run the code for the tests of the class WeatherData, in {\b WeatherDataTest.java}.}
\par 
\par {\ltrch\loch\f3 *\tab Add the code to test the method {\b tempPhrase() }to class {\b WeatherDataTest}.}
\par 
\par {\ltrch\loch\f3 *\tab Develop the method {\b howWet()} for the class WeatherData. It should return the String "dry" if the precipitation is below 0.01, "wet", if the precipitation is below 0.25, "soggy" if the precipitation is below 1.0 and "very wet" otherwise. Add code to test {\b h
owWet()} to {\b WeatherDataTest}.}
\par 
\par {\ltrch\loch\f3 *\tab Turn in your resulting {\b WeatherData.java}, {\b WeatherDataTest.java}, and the saved console contents from running the test methods within class {\b WeatherDataTest}.}
\par 
\par {\ltrch\loch\f3{\b Exercise 2.3} A class that represents automobiles. }
\par 
\par {\ltrch\loch\f3 *\tab Design the class {\b Car} that records the make and model of the car, the fuel tank capacity in gallons, and the estimated fuel consumption given in miles per gallon. }
\par 
\par {\ltrch\loch\f3 *\tab Develop the constructor and the {\b toString()} method for this class. }
\par 
\par {\ltrch\loch\f3 *\tab Develop the method {\b maxDistance()}, which computes the distance the car can travel on one tank of gas. }
\par 
\par {\ltrch\loch\f3 *\tab Develop the method {\b canReach()}, which determines whether a destination (distance given in miles) is reachable on one tank of gas. }
\par 
\par {\ltrch\loch\f3 *\tab Develop the method {\b goFartherThan()}, which determines whether this car can travel farther on one tank of gas than some other given car. }
\par 
\par {\ltrch\loch\f3 *\tab Turn in your resulting {\b Car.java}, {\b CarTest.java}, and the saved console contents from running the test methods within class {\b CarTest}.}
\par 
\par {\ltrch\loch\f3{\b Exercise 2.4} A class that represents one type of item in a grocery store (a can of coffee). }
\par 
\par {\ltrch\loch\f3 *\tab Design the class {\b Coffee} that represents a coffee can in the grocery store. The relevant information is the brand name, the weight of the can, given in ounces, and the price of the can, given in cents. }
\par 
\par {\ltrch\loch\f3 *\tab Develop the constructor and the {\b toString()} method for this class. }
\par 
\par {\ltrch\loch\f3 *\tab Develop the method {\b unitPrice()}, which computes the price per ounce of this grocery item. }
\par 
\par {\ltrch\loch\f3 *\tab Develop the method {\b isCheaperThan()}, which determines whether the unit price is lower that some given price. }
\par 
\par {\ltrch\loch\f3 *\tab Develop the method {\b betterPriceThan()} for this class, that determines whether this coffee is cheaper (in terms of the unit price) than some other given Coffee. }
\par 
\par {\ltrch\loch\f3 *\tab Turn in your resulting {\b Coffee.java}, {\b CoffeeTest.java}, and the saved console contents from running the test methods within class {\b CoffeeTest}.}
\par 
\par {\ltrch\loch\f3{\b Exercise 2.5} A class that represents weather data for a particular day.}
\par 
\par {\ltrch\loch\f3 *\tab See the links from the course web page for classes {\b DayData.java} and {\b DayDataTest.java}.}
\par 
\par {\ltrch\loch\f3 *\tab Run the existing code for the tests of class {\b DayData} in class {\b DayDataTest}.}
\par 
\par {\ltrch\loch\f3 *\tab Complete the test suite for class {\b DayData} within {\b DataDataTest}.}
\par 
\par {\ltrch\loch\f3 *\tab Turn in your resulting {\b DayDataTest.java}, and the saved console contents from running the test methods within class {\b DayDataTest}.}
\par 
\par {\ltrch\loch\f3{\b Exercise 2.6} A class that represents inventory information about an item in a grocery store (a can of coffee). }
\par 
\par {\ltrch\loch\f3 *\tab Design the class {\b InventoryItem} that keeps a record of the number of specific Coffee items in stock, as well as the number that have been sold. }
\par 
\par {\ltrch\loch\f3 *\tab Develop the constructor and the {\b toString()} method for this class. }
\par 
\par {\ltrch\loch\f3 *\tab Develop the method {\b itemValue()}, which computes the value of the current stock of Coffee items. }
\par 
\par {\ltrch\loch\f3 *\tab Develop the method {\b grossIncome()}, which determines the amount of money received for the Coffee items already sold. }
\par 
\par {\ltrch\loch\f3 *\tab Turn in your resulting {\b InventoryItem.java}, {\b InventoryItemTest.java}, and the saved console contents from running the test methods within class {\b InventoryItemTest}.}
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\fs24\b 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\ltrch\loch\f2\fs24 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033 
\par \pard\plain \s1\cf1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\aspalpha\rtlch\af6\afs24\lang255\ltrch\dbch\af5\afs24\langfe255\loch\f3\fs20\lang1033\li360\ri0\fi-360 
\par }