{\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;}{\f29\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;}{\f265\fswiss\fcharset0\fprq2 Arial Unicode MS Western;}{\f263\fswiss\fcharset238\fprq2 Arial Unicode MS CE;}{\f264\fswiss\fcharset204\fprq2 Arial Unicode MS Cyr;}
{\f266\fswiss\fcharset161\fprq2 Arial Unicode MS Greek;}{\f267\fswiss\fcharset162\fprq2 Arial Unicode MS Tur;}{\f268\fswiss\fcharset177\fprq2 Arial Unicode MS (Hebrew);}{\f269\fswiss\fcharset178\fprq2 Arial Unicode MS (Arabic);}
{\f270\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\faauto\rin0\lin0\itap0 
\fs24\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\keepn\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \b\fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon0 \snext0 heading 2;}{\*\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 \li0\ri0\nowidctlpar\tqc\tx4320\tqr\tx8640\aspalpha\faauto\rin0\lin0\itap0 
\fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext20 header;}{\s21\ql \li0\ri0\nowidctlpar\tqc\tx4320\tqr\tx8640\aspalpha\faauto\rin0\lin0\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext21 
footer;}{\s22\ql \li0\ri0\sa120\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon16 \snext22 Table Contents;}{\s23\qc \li0\ri0\sa120\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 
\b\i\fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon22 \snext23 Table Heading;}{\s24\ql \li0\ri0\sb120\sa120\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \i\fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext24 
caption;}{\s25\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 \sbasedon15 \snext25 Index;}{\s26\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 \snext27 Title;}{\s27\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;}{\*\cs28 \additive \fs24\cf1\lang0\langfe255\langfenp255 Numbering Symbols;}{\*\cs29 \additive \fs24\cf1\lang0\langfe255\langfenp255 
WW-Default Paragraph Font;}{\*\cs30 \additive \fs24\cf1\lang0\langfe255\langfenp255 \sbasedon29 page number;}}{\info{\title hw02 - cs131 - f02}{\author CNRS}{\operator CNRS}{\creatim\yr2001\mo6\dy25\hr10\min4}{\revtim\yr2002\mo9\dy3\hr8\min59}
{\printim\yr2002\mo8\dy29\hr18\min43}{\version2}{\edmins1}{\nofpages2}{\nofwords632}{\nofchars3605}{\*\company CNRS-HSU}{\nofcharsws4427}{\vern8269}}\margl1440\margr1440\margt1400\margb720 
\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale92\viewzk2\nolnhtadjtbl \fet0\sectd 
\sbknone\linex0\headery709\sectdefaultcl {\header \pard\plain \s20\ql \li0\ri0\nowidctlpar\tqc\tx4320\tqr\tx8640\aspalpha\faauto\rin0\lin0\itap0 \fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 {\fs16 CS 131 - Homework #2\tab \tab p. }
{\field{\*\fldinst {\cs30\fs16  PAGE }}{\fldrslt {\cs30\fs16\lang1024\langfe1024\noproof 2}}}{\field\flddirty{\*\fldinst {\fs16 \\page\\* ARABIC}}{\fldrslt {\fs16 2}}}{\fs16 
\par Fall 2002
\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\aspalpha\faauto\rin0\lin0\itap0 
\fs20\cf1\lang1033\langfe255\cgrid\langnp1033\langfenp255 {\b CS 131 - Intro to Computer Science I - Fall 2002
\par Homework #2
\par DUE: Tursday, September 10th, }{\b\ul Beginning}{\b  of Lecture
\par }\pard \s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {
\par This, too, should be an individual-work-only assignment (no pairs this time, either). Note that program contracts (to be discussed on Thursday) are }{\b not}{
 required for the assignment, although you may use them if you wish. (They will be required starting with HW #3.)
\par 
\par }\pard \s15\ql \fi-435\li420\ri0\nowidctlpar\aspalpha\faauto\rin0\lin420\itap0 {0.\tab 
Start up DrScheme. In the definitions window type in a comment-line containing your name, followed by a comment-line containing CS 131 HW 2, followed by a comment-line with no other text in it --- that is,
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 ; type in YOUR name
\par \hich\af0\dbch\af0\loch\f2 ; CS 131 HW 2
\par \hich\af0\dbch\af0\loch\f2 ;
\par 
\par }{1.\tab Below what you typed in #0 above, type the comment line:
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 ; Problem 1
\par }{\tab In the definitions window, type in these particular functions/operations/programs from Week 2 Lecture 1 (September 3, 2002): }{\b area-of-rect}{, }{\b cost-per-slice}{, }{\b my-pizza-bill}{, }{\b circ-disk-area, toppings-area }{
. Precede each with a 3-line "comment" as shown in class (and in the in-class examples) including the name of the function/operation/program. 
\par 
\par \tab Click the execute button. Go to the interactions window and invoke each function on two different sets of arguments (other than those used in the in-class examples). 
\par 
\par \tab But, I cannot see that "practice", can I? So, now that you are comfortable }{\b executing}{ these functions, type in }{\b two}{ executions of each function directly after its definition in the de
finitions window, using any arguments that you wish (as long as they are different from the in-class examples). You should see the results of these executions when you now click the execute button.
\par 
\par \tab (Note: I would type the execute button after each example, to see if all is going well, and then once again at the end...)
\par 
\par }\pard \s15\ql \fi-435\li450\ri0\nowidctlpar\aspalpha\faauto\rin0\lin450\itap0 {2.\tab Now, in your definition window, type the comment line
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 ;\tab Problem 2
\par \tab }{Write a function/operation/program }{\b minutes->hours }{(that "arrow" in the middle is typed as a hyphen followed by a right angle bracket, }{\loch\af2 \hich\af0\dbch\af0\loch\f2 ->}{
) that takes a number of minutes and converts it to a number of hours. Type your definition in the definitions window, preceding it by a 3-line comment as in problem #1. }{\loch\af2 
\par }{
\par \tab 
Test your program on several arguments; include two test-executions of your program after its definition in the definitions window. Click the execute button one more time after you are done to make sure that the results of the executions are what you expe
ct.
\par 
\par 3.\tab Now, in your definition window, type the comment line
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 ;\tab Problem 3
\par }{\f2 \tab }{Write a function/operation/program }{\b total-inches}{ that takes a number of feet and a number of inches, and returns the total number of inches. (For example, }{\b\f2 (total-inches 4 5)}{\b  }{\loch\af2 \hich\af0\dbch\af0\loch\f2 should re
\hich\af0\dbch\af0\loch\f2 turn }{\b\f2 53}{, because 4 feet and 5 inches is 53 inches overall.) Type your definition in the definitions window, preceding it by a 3-line comment as in problem #1. }{
\par 
\par \tab Test your program on several arguments; include two test-executions of your program after its 
definition in the definitions window, BUT, this time, make sure that one of those executions uses the arguments 4 and 5 from the given example. (Why? Because that is an important }{\b software testing }{
technique: you test your software, as often as possible, on examples where you know what the answers }{\b should}{ be. It doesn't}{\b  prove}{ that your program is correct, but it does}{\b  increase your confidence}{ that it might be.)}{\b  }{
Click the execute button one more time after you are done to make sure that the results of the executions are what you expect.
\par 
\par (continued on next page)
\par \page 4.\tab Now, in your definition window, type the comment line
\par }{\loch\af2 \hich\af0\dbch\af0\loch\f2 ;\tab Problem 4
\par \tab }{Write a function/operation/program }{\b area-of-triangle }{that computes a triangle's area. What information will you need? Once you have th
at information, how can you compute the triangle's area? Type your definition in the definitions window, preceding it by a 3-line comment as in problem #1. }{\loch\af2 
\par }{
\par \tab Test your program on several sets of arguments; include two test-executions of your program after
 its definition in the definitions window. Click the execute button one more time after you are done to make sure that the results of the executions are what you expect.
\par 
\par When you are done with problems 1-4, save your definitions window contents using the "Save Definitions" command under the File menu. E-mail the contents of this saved file to }{\b st10@humboldt.edu}{
, either by cut-and-paste or attachment or whatever is easiest for you. Make the subject line of your message }{\b 131hw02}{. 
\par }\pard \s15\ql \li0\ri0\nowidctlpar\aspalpha\faauto\rin0\lin0\itap0 {
\par 
\par }}