{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman{\*\falt Thorndale};}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f28\fswiss\fcharset128\fprq2{\*\panose 020b0604020202020204}Arial Unicode MS;}{\f30\fswiss\fcharset128\fprq2 @Arial Unicode MS;}
{\f31\froman\fcharset238\fprq2 Times New Roman CE{\*\falt Thorndale};}{\f32\froman\fcharset204\fprq2 Times New Roman Cyr{\*\falt Thorndale};}{\f34\froman\fcharset161\fprq2 Times New Roman Greek{\*\falt Thorndale};}
{\f35\froman\fcharset162\fprq2 Times New Roman Tur{\*\falt Thorndale};}{\f36\froman\fcharset177\fprq2 Times New Roman (Hebrew){\*\falt Thorndale};}{\f37\froman\fcharset178\fprq2 Times New Roman (Arabic){\*\falt Thorndale};}
{\f38\froman\fcharset186\fprq2 Times New Roman Baltic{\*\falt Thorndale};}{\f39\fswiss\fcharset238\fprq2 Arial CE;}{\f40\fswiss\fcharset204\fprq2 Arial Cyr;}{\f42\fswiss\fcharset161\fprq2 Arial Greek;}{\f43\fswiss\fcharset162\fprq2 Arial Tur;}
{\f44\fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f45\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f46\fswiss\fcharset186\fprq2 Arial Baltic;}{\f47\fmodern\fcharset238\fprq1 Courier New CE;}{\f48\fmodern\fcharset204\fprq1 Courier New Cyr;}
{\f50\fmodern\fcharset161\fprq1 Courier New Greek;}{\f51\fmodern\fcharset162\fprq1 Courier New Tur;}{\f52\fmodern\fcharset177\fprq1 Courier New (Hebrew);}{\f53\fmodern\fcharset178\fprq1 Courier New (Arabic);}
{\f54\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f257\fswiss\fcharset0\fprq2 Arial Unicode MS Western;}{\f255\fswiss\fcharset238\fprq2 Arial Unicode MS CE;}{\f256\fswiss\fcharset204\fprq2 Arial Unicode MS Cyr;}
{\f258\fswiss\fcharset161\fprq2 Arial Unicode MS Greek;}{\f259\fswiss\fcharset162\fprq2 Arial Unicode MS Tur;}{\f260\fswiss\fcharset177\fprq2 Arial Unicode MS (Hebrew);}{\f261\fswiss\fcharset178\fprq2 Arial Unicode MS (Arabic);}
{\f262\fswiss\fcharset186\fprq2 Arial Unicode MS Baltic;}{\f273\fswiss\fcharset0\fprq2 @Arial Unicode MS Western;}{\f271\fswiss\fcharset238\fprq2 @Arial Unicode MS CE;}{\f272\fswiss\fcharset204\fprq2 @Arial Unicode MS Cyr;}
{\f274\fswiss\fcharset161\fprq2 @Arial Unicode MS Greek;}{\f275\fswiss\fcharset162\fprq2 @Arial Unicode MS Tur;}{\f276\fswiss\fcharset177\fprq2 @Arial Unicode MS (Hebrew);}{\f277\fswiss\fcharset178\fprq2 @Arial Unicode MS (Arabic);}
{\f278\fswiss\fcharset186\fprq2 @Arial Unicode MS Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;
\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 
\fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \snext0 Normal;}{\s1\ql \li0\ri0\sb240\sa60\keepn\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \b\fs28\cf1\lang1033\langfe255\loch\f1\hich\af0\dbch\af0\cgrid\langnp1033\langfenp255 
\sbasedon15 \snext15 heading 1;}{\s2\ql \li0\ri0\sb240\sa60\keepn\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \b\i\fs24\cf1\lang1033\langfe255\loch\f1\hich\af0\dbch\af0\cgrid\langnp1033\langfenp255 \sbasedon15 \snext15 heading 2;}{
\s3\ql \li0\ri0\sb240\sa60\keepn\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \fs24\cf1\lang1033\langfe255\loch\f1\hich\af0\dbch\af0\cgrid\langnp1033\langfenp255 \sbasedon15 \snext15 heading 3;}{
\s4\ql \li0\ri0\sb240\sa60\keepn\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \b\fs24\cf1\lang1033\langfe255\loch\f1\hich\af0\dbch\af0\cgrid\langnp1033\langfenp255 \sbasedon15 \snext15 heading 4;}{
\s5\ql \li0\ri0\sb240\sa60\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \fs22\cf1\lang1033\langfe255\loch\f1\hich\af0\dbch\af0\cgrid\langnp1033\langfenp255 \sbasedon15 \snext15 heading 5;}{
\s6\ql \li0\ri0\sb240\sa60\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \i\fs22\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext15 heading 6;}{\*\cs10 \additive Default Paragraph Font;}{
\s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \snext15 Default;}{\s16\ql \li0\ri0\sa120\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 
\fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext16 Text body;}{\s17\ql \li0\ri0\sb240\sa120\keepn\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \fs28\cf1\lang1033\langfe255\loch\f1\hich\af0\dbch\af0\cgrid\langnp1033\langfenp255 
\sbasedon15 \snext16 Heading;}{\s18\ql \fi-360\li360\ri0\nowidctlpar\aspalpha\faauto\rin0\lin360\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext18 List;}{
\s19\ql \fi-360\li720\ri0\nowidctlpar\aspalpha\faauto\rin0\lin720\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext19 List 2;}{\s20\ql \fi-360\li1080\ri0\nowidctlpar\aspalpha\faauto\rin0\lin1080\itap0 
\fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext20 List 3;}{\s21\ql \li0\ri0\nowidctlpar\tqc\tx4320\tqr\tx8640\aspalpha\faauto\rin0\lin0\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext21 
header;}{\s22\ql \li0\ri0\nowidctlpar\tqc\tx4320\tqr\tx8640\aspalpha\faauto\rin0\lin0\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext22 footer;}{\s23\qc \li0\ri0\sb240\sa60\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 
\b\fs32\cf1\lang1033\langfe255\loch\f1\hich\af0\dbch\af0\cgrid\langnp1033\langfenp255 \sbasedon15 \snext24 Title;}{\s24\qc \li0\ri0\sa60\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 
\fs24\cf1\lang1033\langfe255\loch\f1\hich\af0\dbch\af0\cgrid\langnp1033\langfenp255 \sbasedon15 \snext16 Subtitle;}{\s25\ql \fi1\li360\ri0\sa120\nowidctlpar\aspalpha\faauto\rin0\lin360\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 
\sbasedon15 \snext25 WW-List Continue;}{\s26\ql \fi1\li360\ri0\sa120\nowidctlpar\aspalpha\faauto\rin0\lin360\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext26 WW-Body Text 2;}{
\s27\ql \fi1\li360\ri0\sa120\nowidctlpar\aspalpha\faauto\rin0\lin360\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon26 \snext27 WW-Body Text 3;}{\s28\ql \li720\ri0\nowidctlpar\aspalpha\faauto\rin0\lin720\itap0 
\fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon0 \snext28 Body Text 2;}{\*\cs29 \additive \fs24\cf1\up10\lang0\langfe255\langfenp255 \sbasedon31 Footnote Characters;}{\*\cs30 \additive \fs24\cf1\lang0\langfe255\langfenp255 \sbasedon10 
page number;}{\*\cs31 \additive \fs24\cf1\lang0\langfe255\langfenp255 WW-Absatz-Standardschriftart;}{\*\cs32 \additive \fs24\cf1\lang0\langfe255\langfenp255 WW-Absatz-Standardschriftart1;}{\*\cs33 \additive \fs24\cf1\up10\lang0\langfe255\langfenp255 
\sbasedon32 WW-Footnote Symbol;}{\*\cs34 \additive \fs24\cf1\lang0\langfe255\langfenp255 WW-Default Paragraph Font;}{\*\cs35 \additive \fs24\cf1\lang0\langfe255\langfenp255 WW-Page Number;}{\*\cs36 \additive \fs24\cf1\lang0\langfe255\langfenp255 
\sbasedon34 WW-Page Number1;}{\*\cs37 \additive \b\fs24\cf1\lang0\langfe255\langfenp255 \sbasedon34 WW-Strong;}{\*\cs38 \additive \fs24\ul\cf9\lang0\langfe255\langfenp255 Internet Link;}}{\info{\title hw01 - cs132 - s02}{\author Sharon Tuttle}
{\operator CNRS}{\creatim\yr2003\mo1\dy28\hr11\min25}{\revtim\yr2003\mo1\dy28\hr11\min25}{\printim\yr2002\mo1\dy29\hr16\min32}{\version2}{\edmins0}{\nofpages4}{\nofwords1524}{\nofchars8691}{\*\company CNRS-HSU}{\nofcharsws10673}{\vern8269}}
\margl1440\margr1440\margt1303\margb720 \widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\nolnhtadjtbl 
\fet0\sectd \sbknone\linex0\sectdefaultcl {\header \pard\plain \s21\ql \li0\ri0\nowidctlpar\tqc\tx4320\tqr\tx8640\aspalpha\faauto\rin0\lin0\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 {\fs12 CIS 132 - HW #1\tab \tab p. }
{\field{\*\fldinst {\fs12 \\page}}{\fldrslt {\fs12\lang1024\langfe1024\noproof 4}}}{\fs12 
\par Spring 2003
\par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}
{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8
\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s15\qc \li0\ri0\nowidctlpar\tx6300\aspalpha\faauto\rin0\lin0\itap0 
\fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 {\b HUMBOLDT STATE UNIVERSITY
\par }\pard \s15\qc \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {\b CIS 132 - Introduction to Computer Science II - Spring 2003
\par Homework #1 - due Tuesday, February 4th,  beginning of class
\par }\pard \s15\ql \li0\ri0\nowidctlpar\tx1260\aspalpha\faauto\rin0\lin0\itap0 {\b 
\par }\pard \s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {(adapted from Northeastern University's 
\par Winter 2003: COM 1101 Algorithms and Data Structures 1,
\par taught by Viera K. Proulx, and assignment set by Viera K. Proulx and Matthias Felleisen)
\par }{\b 
\par }{\b\fs24 PART 1A: Exploring Numbers and Arithmetic
\par }{
\par You'll find a link }{\b Exercise1A.java}{ on the course web page. You will }{\b use}{ this to get comfortable with Java, some of its basic numeric types, and its arithmetic expressions.
\par 
\par To compile this under BlueJ, you will need to make sure that }{\b jpt.jar}{ and }{\b Base.jar}{ are included in the Bluej U
ser Libraries (as demonstrated in the first lab session). (Both jar files are available from the course web page, under References, remember!) Then, create a new project (any name is fine), and within that project create a }{\b New Class}{ named }{\b 
Exercise1A}{. Paste the contents of }{\b Exercise1A.java}{ there, and compile.
\par 
\par To run the functions here is a little different from last lab's examples:
\par }\pard \s15\ql \fi-435\li855\ri0\nowidctlpar\aspalpha\faauto\rin0\lin855\itap0 {*\tab right-click on the class box for }{\b Exercise1A}{
\par }{\b 
\par }{*\tab select }{\b new Exercise1a() }{from the menu, to create a new instance of Exercise1A. (Its name doesn't matter, for our purposes --- the default is fine.)
\par 
\par *\tab right-click on the red box that results, and select the function/method that you wish to run. Say, for example, that it is }{\b computeInt()}{. Then select }{\b int computeInt(int)}{ and type (or pa
ste!) in the desired argument (say, one of the arithmetic expressions from 1A.1 below, such as }{\b 27 % 4}{. A window containing the result should then pop up.
\par 
\par }\pard \s15\ql \li-15\ri0\nowidctlpar\aspalpha\faauto\rin0\lin-15\itap0 {How will you turn these in? Paste or type in the results that you get for each expression  }{\b or}{ your answer to any additional questions asked into a text file, named }{\b 
ex1A.txt}{, and e-mail me your resulting file. (Ideally, you should predict by hand what you'll get for each, and then see if the result you get matches that...) If an error results, simply note 
that an error resulted --- you do not have to paste in the entire error message. (If you get no error message, but nothing happens? That's probably a run-time error --- note that nothing happened, in that case.)
\par 
\par }{\b Exercise 1A.1}{ Use the function }{\b computeInt()}{ to determine the result of the following expressions:
\par 
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 27 % 4
\par \hich\af0\dbch\af0\loch\f2 -27 % 4
\par \hich\af0\dbch\af0\loch\f2 27 % -4
\par \hich\af0\dbch\af0\loch\f2 -27 % -4
\par \hich\af0\dbch\af0\loch\f2 27.5 % 4
\par }{
\par }{\b Exercise 1A.2}{ Use the function }{\b computeInt()}{ to determine the result of the following expressions:
\par 
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 150 / 3 * 10
\par \hich\af0\dbch\af0\loch\f2 150 / (3 * 10)
\par \hich\af0\dbch\af0\loch\f2 10 / 3 * 10
\par }{
\par }{\b Exercise 1A.3}{ Use the function }{\b computeInt()}{ to determine the result of the following expressions:
\par 
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 150 - 20 - 30 - 10
\par \hich\af0\dbch\af0\loch\f2 150 - (20 - 30) - 10)
\par \hich\af0\dbch\af0\loch\f2 (150 - 20) - (30 - 10)
\par }{
\par }{\b Exercise 1A.4}{ Use the function }{\b computeInt()}{ to determine the result of the following expressions. Experiment with the second expression to find out what is the largest integer Java can represent.
\par 
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4
\par \hich\af0\dbch\af0\loch\f2 16 * 16 * 16 * 16 * 16 * 16 * 16 * 16 * 16 * 16
\par }{
\par }{\b Exercise 1A.5}{ Use the function }{\b computeInt()}{ to determine the result of the following expressions. Experiment with the second expression to find out what is the largest magnitude of a negative integer that Java can represent.
\par 
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 -4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4 * 4
\par \hich\af0\dbch\af0\loch\f2 -16 * 16 * 16 * 16 * 16 * 16\hich\af0\dbch\af0\loch\f2  * 16 * 16 * 16 * 16
\par }{
\par }{\b Exercise 1A.6}{ Use the function }{\b computeDouble()}{ to determine the result of the following expressions:
\par 
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 27.6 % 4
\par \hich\af0\dbch\af0\loch\f2 -27.6 % 4
\par \hich\af0\dbch\af0\loch\f2 27.6 % -4
\par \hich\af0\dbch\af0\loch\f2 -27.6 % -4
\par }{
\par }{\b Exercise 1A.7}{ Use the function }{\b computeDouble()}{ to determine the result of the following expressions:
\par 
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 10 / 3 * 3.0)
\par \hich\af0\dbch\af0\loch\f2 10 / 3.0 * 3
\par \hich\af0\dbch\af0\loch\f2 10.0 / 3 * 3
\par \hich\af0\dbch\af0\loch\f2 10.0/3/3/3/3/3 *3*3*3*3*3
\par \hich\af0\dbch\af0\loch\f2 10.0/3/3/3/3/3/3/3/3/3/3 *3*3*3*3*3*3*3*3*3*3
\par \hich\af0\dbch\af0\loch\f2 10.0 *3*3*3*3*3*3*3*3*3*3 /3/3/3/3/3/3/3/3/3/3
\par \hich\af0\dbch\af0\loch\f2 1E20 /3/3/3/3/3/3/3/3/3/3 *3*3*3*3*3*3*3*\hich\af0\dbch\af0\loch\f2 3*3*3
\par \hich\af0\dbch\af0\loch\f2 1E20 *3*3*3*3*3*3*3*3*3*3 /3/3/3/3/3/3/3/3/3/3
\par }{
\par }{\b Exercise 1A.8}{ Use the function }{\b computeDouble()}{ to determine the result of the following expressions:
\par 
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 1.0 / 0
\par \hich\af0\dbch\af0\loch\f2 -1.0 / 0
\par \hich\af0\dbch\af0\loch\f2 0.0 / 0
\par \hich\af0\dbch\af0\loch\f2 1 / 0
\par }{
\par }{\b Exercise 1A.9}{ Find out whether the function }{\b areaOfDisk() }{allows the input to be an integer.
\par 
\par }{\b Exercise 1A.10}{ Find out what happens if you use }{\b int}{ return type in the function }{\b areaOfDisk()}{ instead of }{\b double}{. (Actually try to change the function, recompile if you can, and run }{\b areaOfDiskTests()}{
 again if you can --- How far do you get? What happens?)
\par }\pard \s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {
\par }{\b\fs24 PART 1B: Developing Functions; Function Composition
\par }{
\par Consider link }{\b Exercise1B.java}{ on the course web page. This is a template that you will }{\b fill in}{ with your answers to the following. You'll }{\b add}{ a comment to the top including your }{\b name}{, and }{\b when}{
 your last modification to the file was (the }{\b date}{ of your last modification). You will turn in your final resulting version of }{\b Exercise1B.java}{ by e-mailing it to me.
\par 
\par For each function that you write, you should precede it with a }{\b purpose}{ statement, as described in class and in the class readings, and you should follow it with a testing function making use of }{\b testHeader()}{, }{\b expected()}{, and }{\b 
actual()}{, as described in class and in the class readings. (The testing function only needs to be preceded by its }{\b Examples/Testing}{ comment --- that IS its purpose, after all!) Remember to use }{\b named constants}{
 as described in lab when they are appropriate!
\par 
\par }{\b Exercise 1B.1}{ Test the following four functions with the same set of inputs. (You'll have to write these fo
ur functions, note.) Try to predict the outcome. Consider (but you do not need to turn this in): how can you explain the differences between the different results?
\par 
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 c1(f): ((f-32)*5)/9
\par \hich\af0\dbch\af0\loch\f2 c2(f): (f-32)*(5/9)
\par \hich\af0\dbch\af0\loch\f2 c3(f): (((f-32)/9)*5)
\par \hich\af0\dbch\af0\loch\f2 c4(f): (f-32*5/9)
\par }{\page }{\b Exercise 1B.2}{ Develop the function }{\b fToC}{ that converts the temperature given in Fahrenheit to a temperature in Celsius. In this case represent all temperatures as integers, which is sufficient for weather reports.
\par 
\par }{\b Exercise 1B.3}{ Develop the function }{\b travelTime}{ that computes how long a car trip takes (in hours and fractions of an hour), given the distance in miles and the estimated average speed in miles per hour.
\par 
\par }{\b Exercise 1B.4}{ Develop the function }{\b travelTimeInMinutes}{ that computes how long a car trip takes (in minutes), given the distance in miles and the estimated average speed in miles per hour. Use the function }{\b travelTime}{
 as a helper function.
\par 
\par }{\b Exercise 1B.5}{ Develop the function }{\b numberOfPages}{ that estimates the number of pages in a document, given the number of words in the document. Assume that a page has on the average 60 lines and a line has on the average 15 words in it.
\par 
\par }{\b Exercise 1B.6}{ Develop the function }{\b timeToDownload}{ that estimates the time for downloading a
n image file from the web, given the pixel size and the download speed. The size of the picture is given by the number of pixels in each row and the number of rows of pixels. The download speed is given in the number of bytes per second. Each pixel requir
es three bytes.
\par 
\par }{\b Exercise 1B.7}{ Develop the function }{\b unitPrice}{ that computes the unit price of a grocery item, given the weight and price of an item. The weight of the item is given in pounds and ounces. The price of the item is given in cents (i.e., for an 
item that costs $2.45 the price is given as the integer value 245).
\par 
\par }{\b Exercise 1B.8}{ Develop the function }{\b howManyTiles}{ that computes how many tiles are needed to cover the floor during kitchen renovation, given the area of the kitchen and the size of the til
e. The area of the kitchen is given in square feet. The size of the tile is given in inches. Assume the tiles are square.
\par }\pard \s15\ql \fi-435\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {
\par }\pard \s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {\b\fs24 PART 1C: Functions with Conditionals
\par }\pard \s15\ql \fi-360\li360\ri0\nowidctlpar\aspalpha\faauto\rin0\lin360\itap0 {
\par }\pard \s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {Consider link }{\b Exercise1C.java}{ on the course web page. This is a template that you will }{\b fill in}{ with your answers to the following. You'll }{\b add}{
 a comment to the top including your }{\b name}{, and }{\b when}{ your last modification to the file was (the }{\b date}{ of your last modification). You will turn in your final resulting version of }{\b Exercise1C.java}{ by e-mailing it to me.
\par 
\par For each function that you write, you should precede it with a }{\b purpose}{ statement, as described in class and in the class readings, and you should follow it with a testing function making use of }{\b testHeader()}{, }{\b expected()}{, and }{\b 
actual()}{, as described in class and in the class readings. (The testing function only needs to be preceded by its }{\b Examples/Testing}{ comment --- that IS its purpose, after all!) Remember to use }{\b named constants}{
 as described in lab when they are appropriate!
\par }\pard \s15\ql \fi-360\li360\ri0\nowidctlpar\aspalpha\faauto\rin0\lin360\itap0 {
\par }\pard \s15\ql \fi-15\li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {\b Exercise 1C.1}{ Develop the function }{\b taxRate}{
 that determines the tax rate for a given income level. If the income is under $6000, there is no tax. For an income under $20000 the tax is 15%, for income under $70000 the tax is 24%, for $70000 and over the tax is 33%.
\par Develop the function }{\b computeTax}{ that will compute the amount of tax for the given income, using the tax rates as determined earlier.
\par 
\par }{\b Exercise 1C.2}{ Develop the function }{\b ticketType}{ that produces an age label (a String) for a ski ticket, given the age of the skier. The res
ult is "Child" for those under six years old, "Youth" for those under twelve, "Student" for those under 21, "Adult" for those under 65, and "Senior" for anyone 65 and older.
\par 
\par }{\b Exercise 1C.3}{ Develop the function }{\b letterGrade}{ that consumes the exam score (betw
een 0 and 100) and produces a character representing the earned grade as follows: 85 and above is A, 70 and above is B, 60 and above is C, 50 and above is D, below 50 is F.
\par 
\par }{\b Exercise 1C.4}{ Develop the function }{\b passing}{ that consumes the exam scores from two 
exams (a midterm and a final) and produces a Boolean value that indicates whether the student passes the course. Student who either failed both exams, or got F on one exam and D on the other, fails the course, otherwise student passes the course.
\par 
\par Hint: Use the function }{\b letterGrade}{ as a helper.
\par 
\par }{\b Exercise 1C.5}{ Develop the function }{\b computeToll}{ that computes the toll for a vehicle passing through the toll booth, given information about the vehicle. The vehicle driver hands in a ticket with one character code a
s follows: A is for a passenger car (automobile), B is for bus, T is for a truck, W is for a car towing a small trailer or a boat or an airplane (glider in a box). The ticket also has the code that determines the distance travelled. The toll structure is 
a
s follows. Passenger cars pay $0.25 per 10 miles of travel, rounded down, car with a trailer pays $0.35 per 10 miles. Bus pays $0.50 per 10 miles and an additional surcharge of $5 if the distance is greater than 100 miles. Trucks pay $0.40 per 10 miles, w
ith a minimum of $5.
\par 
\par Remember the basic guidelines and develop two auxiliary functions to deal with bus and truck tolls.
\par 
\par Your purpose statement must specify clearly the range of acceptable input values for the vehicle code and the distance travelled.
\par 
\par }\pard \s15\ql \fi-360\li360\ri0\nowidctlpar\aspalpha\faauto\rin0\lin360\itap0 {
\par 
\par }}