{VERSION 6 1 "Windows XP" "6.1" } {USTYLETAB {PSTYLE "Warning" -1 7 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{PSTYLE "Dash Item" -1 16 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 -1 3 3 1 0 1 0 2 2 -1 3 }{PSTYLE "Heading 4" -1 20 1 {CSTYLE "" -1 -1 "MS Serif" 1 12 0 0 0 0 1 0 0 2 2 2 0 0 0 1 }1 1 0 -1 0 0 1 0 1 0 2 2 -1 1 }{PSTYLE "Heading 3" -1 5 1 {CSTYLE "" -1 -1 " MS Serif" 1 14 0 0 0 0 1 1 0 2 2 2 0 0 0 1 }1 1 0 -1 0 0 1 0 1 0 2 2 -1 1 }{PSTYLE "Error" -1 8 1 {CSTYLE "" -1 -1 "Courier" 1 12 255 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{PSTYLE "A uthor" -1 19 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }3 1 0 -1 8 8 1 0 1 0 2 2 -1 1 }{PSTYLE "Heading 2" -1 4 1 {CSTYLE "" -1 -1 "MS Serif" 1 16 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }1 1 0 -1 8 2 1 0 1 0 2 2 -1 1 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "MS Serif" 1 18 0 0 0 0 0 1 0 2 2 2 0 0 0 1 }1 1 0 -1 8 4 1 0 1 0 2 2 -1 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{PSTYLE "Maple Plot" -1 13 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{PSTYLE "Line Printed Output" -1 6 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{PSTYLE "Title" -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 0 0 1 1 2 2 2 0 0 0 1 }3 1 0 -1 12 12 1 0 1 0 2 2 -1 1 }{PSTYLE "Map le Output" -1 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{PSTYLE "List Item" -1 14 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 -1 3 3 1 0 1 0 2 2 -1 5 }{PSTYLE "Bullet Item" -1 15 1 {CSTYLE "" -1 -1 "Ti mes" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }1 1 0 -1 3 3 1 0 1 0 2 2 -1 2 } {CSTYLE "Maple Input" -1 0 "Courier" 1 12 255 0 0 1 0 1 0 2 1 2 0 0 0 1 }{CSTYLE "2D Input" -1 19 "Times" 1 12 255 0 0 1 0 0 0 2 1 2 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "MS Serif" 1 12 0 128 128 1 0 0 1 2 2 2 0 0 0 1 }{CSTYLE "Text" -1 200 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 1 12 0 0 0 1 0 0 0 2 2 2 0 0 0 1 } {CSTYLE "Dictionary Hyperlink" -1 45 "MS Serif" 1 12 147 0 15 1 0 0 1 2 2 2 0 0 0 1 }{CSTYLE "Maple Input Placeholder" -1 201 "Courier" 1 12 200 0 200 1 0 1 0 2 1 2 0 0 0 1 }{CSTYLE "2D Output" -1 20 "Times" 1 12 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }{CSTYLE "Page Number" -1 33 "Times " 1 10 0 0 0 0 0 0 2 2 2 2 0 0 0 1 }{PSTYLE "_pstyle1" -1 200 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }3 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{CSTYLE "_cstyle1" -1 202 "Times" 1 16 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle2" -1 203 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{PSTYLE "_pstyle2" -1 201 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 } {CSTYLE "_cstyle3" -1 204 "Times" 1 14 0 0 0 1 2 1 1 2 2 2 0 0 0 1 } {CSTYLE "_cstyle4" -1 205 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 } {PSTYLE "_pstyle3" -1 202 1 {CSTYLE "" -1 -1 "Courier" 1 12 255 0 0 1 0 1 0 2 1 2 1 0 0 1 }1 1 0 0 0 0 2 0 2 0 2 2 -1 1 }{CSTYLE "_cstyle5" -1 206 "Courier" 1 12 255 0 0 1 0 1 0 2 1 2 0 0 0 1 }{PSTYLE "_pstyle4 " -1 203 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 255 1 0 0 0 2 2 1 0 0 0 1 }3 3 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{CSTYLE "_cstyle6" -1 207 "Times" 1 12 0 0 255 1 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle7" -1 208 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle8" -1 209 "Courier" 1 12 255 0 0 1 2 1 2 2 1 2 0 0 0 1 }{PSTYLE "_pstyle5" -1 204 1 {CSTYLE "" -1 -1 "Courier" 1 12 255 0 255 1 0 0 0 2 2 1 0 0 0 1 }1 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{CSTYLE "_cstyle9" -1 210 "Courier" 1 12 255 0 255 1 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle10" -1 211 "Times" 1 12 0 0 0 1 2 2 1 2 2 2 0 0 0 1 }{PSTYLE "_pstyle6" -1 205 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }0 0 0 -1 -1 -1 1 0 1 0 2 2 -1 1 }{CSTYLE "_cstyle11" -1 212 "Times" 0 1 0 0 0 0 0 0 0 2 2 2 0 0 0 1 }{CSTYLE "_cstyle12" -1 213 "Times" 1 14 0 0 0 1 2 1 1 2 2 2 0 0 0 1 }{CSTYLE "_cstyle13" -1 214 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle14" -1 215 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 0 0 0 1 }{CSTYLE "_cstyle15" -1 216 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 0 0 0 1 }} {SECT 0 {EXCHG {PARA 200 "" 0 "" {TEXT 202 29 "Math 365D Lab One - Fal l 2005" }{TEXT 203 0 "" }}{PARA 201 "" 0 "" {TEXT 203 0 "" }{TEXT 203 216 "\nMaple contains thousands of mathematical commands in areas rang ing from calculus to number theory to finance. We will begin with a fe w basics, then concentrate on programming with specific attention to g raph theory." }{TEXT 204 0 "" }{TEXT 204 1 "\n" }{TEXT 204 12 "\nSOME \+ BASICS" }{TEXT 203 0 "" }{TEXT 203 3 "\nA " }{TEXT 205 9 "semicolon" } {TEXT 203 2 " (" }{TEXT 205 1 ";" }{TEXT 203 66 ") at the end of a com mand causes the output to be printed while a " }{TEXT 205 5 "colon" } {TEXT 203 2 " (" }{TEXT 205 1 ":" }{TEXT 203 29 ") suppresses the outp ut. The " }{TEXT 205 5 "ditto" }{TEXT 203 42 " operator, represented b y a percent sign (" }{TEXT 205 1 "%" }{TEXT 203 56 "), refers to the l ast expression computed by Maple. The " }{TEXT 205 5 "sharp" }{TEXT 203 9 " symbol (" }{TEXT 205 1 "#" }{TEXT 203 28 ") allows the user to put in " }{TEXT 205 8 "comments" }{TEXT 203 27 " that are ignored by \+ Maple." }{TEXT 203 0 "" }}{PARA 201 "" 0 "" {TEXT 203 0 "" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 42 "13!; # compute and display 13*12*11*. .*2*1" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"++3-F i" }{TEXT 207 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 62 "is prime(%); # ask if the previous expression is a prime number" } {MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#I&falseGI*prote ctedGF$" }{TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 61 "Exp ressions, such as the previous one, that return values of " }{TEXT 208 5 "true " }{TEXT 203 3 "or " }{TEXT 208 5 "false" }{TEXT 203 62 " \+ are called Boolean expressions - more on them in a later lab." }{TEXT 203 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 19 "We use the symbols \+ " }{TEXT 205 2 ":=" }{TEXT 203 40 " to assign an expression to a varia ble. " }{TEXT 203 0 "" }}{PARA 201 "" 0 "" {TEXT 203 102 "By pressing \+ SHIFT-ENTER instead of ENTER, we get a new line without displaying any output, as follows." }{TEXT 203 0 "" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 70 "x:=(a+b)^8: # assign this to the variable x but don't displa y anything" }{MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 51 "\nexpand(x); # ex pand this expression and display it" }{MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 1 "\n" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#,4*$I\"aG6\"\"\")\"\"\"* &F%\"\"(I\"bGF&F(F'*&F%\"\"'F+\"\"#\"#G*&F%\"\"&F+\"\"$\"#c*&F%\"\"%F+ F5\"#q*&F%F2F+F1F3*&F%F.F+F-F/*&F%F(F+F*F'*$F+F'F(" }{TEXT 207 0 "" }} }{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 89 "y:=evalf[50](Pi); # a f loating point evaluation of the expression to fifty decimal places" } {MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#>I\"yG6\"$\"S^P *Rpr>%)G]zKQVEYQKz*e`EfTJ!#\\" }{TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 167 "It will often be useful (especially when using som e of the built-in graph theory commands) to clear Maple's memory of th e values of all variables. We do this with the " }{TEXT 205 7 "restart " }{TEXT 203 9 " command." }{TEXT 203 0 "" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 8 "restart;" }{MPLTEXT 1 206 0 "" }}}{EXCHG {PARA 202 " > " 0 "" {MPLTEXT 1 206 64 "y; # Maple will no longer remember what we assigned to y earlier" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#I\"yG6\"" }{TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 200 "When we open a Maple worksheet that has been saved, we \+ could execute the commands on an individual basis by hitting ENTER on \+ each line, but there is also a way to execute the entire worksheet at \+ once." }{TEXT 203 0 "" }{TEXT 203 1 "\n" }{TEXT 203 280 "\nGo back and comment out (with a #) the line with the restart command and then exe cute the entire worksheet by using the pull-down menu sequence EDIT:EX ECUTE:WORKSHEET. Maple will execute every command in this worksheet an d thus should now know the expression assigned to y above." }{TEXT 203 0 "" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 2 "y;" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#I\"yG6\"" }{TEXT 207 0 "" }}} {EXCHG {PARA 201 "" 0 "" {TEXT 204 10 "PROCEDURES" }{TEXT 203 0 "" } {TEXT 203 40 "\nWe will do our programming by creating " }{TEXT 205 10 "procedures" }{TEXT 203 45 " as the following simple example illust rates." }{MPLTEXT 1 209 0 "" }{MPLTEXT 1 209 45 "\nraise:=proc(a::inte ger,b::integer)::numeric;" }{MPLTEXT 1 209 0 "" }{MPLTEXT 1 209 50 "\n description \"computes a raised to the bth power\";" }{MPLTEXT 1 209 0 "" }{MPLTEXT 1 209 34 "\n a^b; # returns a^b" } {MPLTEXT 1 209 0 "" }{MPLTEXT 1 209 10 "\nend proc:" }{TEXT 203 0 "" } }}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 11 "raise(3,5);" } {MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"$V#" }{TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 12 "The objects " } {TEXT 205 2 "a " }{TEXT 203 4 "and " }{TEXT 205 2 "b " }{TEXT 203 11 " are called " }{TEXT 205 17 "formal parameters" }{TEXT 203 48 ", and it is considered good form to give each a " }{TEXT 205 16 "type declarat ion" }{TEXT 203 68 " (integer in this case). We have also given the p rocedure itself a " }{TEXT 205 15 "type assertion " }{TEXT 203 10 "(nu meric [" }{TEXT 208 5 "i.e.," }{TEXT 203 116 " integer or fraction or \+ floating(decimal)] here), which tells Maple what sort of object the pr ocedure should return." }{TEXT 203 0 "" }{TEXT 203 1 "\n" }{TEXT 203 57 "\nOnce the procedure is invoked (by executing the command " } {TEXT 205 10 "raise(3,5)" }{TEXT 203 41 "), the formal parameters are \+ replaced by " }{TEXT 205 9 "arguments" }{TEXT 203 4 " or " }{TEXT 205 17 "actual parameters" }{TEXT 203 11 " (3 and 5)." }{TEXT 203 0 "" }}} {EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 77 "raise(3,sqrt(2)); # noti ce what happens if we try to pass an invalid argument" }{MPLTEXT 1 206 0 "" }}{PARA 204 "" 1 "" {TEXT 210 100 "Error, invalid input: rais e expects its 2nd argument, b, to be of type integer, but received 2^( 1/2)" }{TEXT 210 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 56 "Now go back and change the procedure's type assertion to" }{TEXT 205 1 " " } {TEXT 203 20 "integer and execute " }{TEXT 205 11 "raise(5,-1)" } {TEXT 203 1 "." }{TEXT 203 0 "" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 12 "raise(5,-1);" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6##\"\"\"\"\"&" }{TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 234 "So, why didn't this give an error? By default, Maple does not check for procedure type assertion. To activate such checking, we nee d the following command, which you should get in the habit of executin g at the start of each worksheet." }{TEXT 203 0 "" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 28 "kernelopts(assertlevel=2); " }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#\"\"!" }{TEXT 207 0 "" }}} {EXCHG {PARA 201 "" 0 "" {TEXT 203 22 "We've now changed the " }{TEXT 205 11 "assertlevel" }{TEXT 203 40 " to 2, and Maple has displayed wha t the " }{TEXT 211 8 "previous" }{TEXT 203 163 " value of assertlevel \+ was. To confirm that we're now at level 2, we execute the following. ( For more details on kernelopts and assertlevel, please see Maple Help. )" }{TEXT 203 0 "" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 24 "kernelopts (assertlevel);" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 " 6#\"\"#" }{TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 31 "Now go back and re-execute the " }{TEXT 205 12 "raise(5,-1) " }{TEXT 203 46 "command, which should give an error this time." }{TEXT 203 0 "" }} }{EXCHG {PARA 201 "" 0 "" {TEXT 204 15 "DECISION-MAKING" }{TEXT 203 0 "" }{TEXT 203 5 "\nThe " }{TEXT 205 12 "if ... then " }{TEXT 203 81 "s tatement allows us to perform an operation only when a certain conditi on is met." }{TEXT 203 0 "" }}}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 21 "pos:=proc(a::integer)" }{MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 63 "\ndescription \"outputs 'positive' if and only if a is positive\"; " }{MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 30 "\nif a>0 then print(\"Posit ive\")" }{MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 8 "\nend if;" }{MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 10 "\nend proc:" }{MPLTEXT 1 206 0 "" }}} {EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 7 "pos(5);" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#Q)Positive6\"" }{TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 43 "Note the distinction betwee n the procedure " }{TEXT 205 5 "raise" }{TEXT 203 19 " and the procedu re " }{TEXT 205 3 "pos" }{TEXT 203 2 ". " }{TEXT 205 5 "raise" }{TEXT 203 1 " " }{TEXT 211 7 "returns" }{TEXT 203 36 " a value; this is simi lar to making " }{TEXT 205 5 "raise" }{TEXT 203 122 " the name of a fu nction which then takes on a certain value (243 above) after the proce dure is called. On the other hand, " }{TEXT 205 3 "pos" }{TEXT 203 9 " doesn't " }{TEXT 211 6 "return" }{TEXT 203 199 " anything; instead, o ne of the commands within this procedure displays the word \"Positive \" under certain conditions. This distinction will become more clear \+ as we see further examples in later labs." }{TEXT 203 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 4 "The " }{TEXT 205 20 "if ... then ... el se" }{TEXT 203 259 " statement gives additional flexibility. We can al so \"nest\" if statements within if statements repeatedly if we need t o examine several cases. We will look more fully at nesting in a later lab, but you can probably figure it out on your own today if you wish ." }{TEXT 203 0 "" }}{PARA 202 "> " 0 "" {MPLTEXT 1 206 77 "absoluteva lue:=proc(x::float)::float; # the type 'float' lets us use decimals" } {MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 47 "\ndescription \"outputs the ab solute value of x\";" }{MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 18 "\nif x \+ >= 0 then x " }{MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 16 "\n else \+ -x" }{MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 8 "\nend if;" }{MPLTEXT 1 206 0 "" }{MPLTEXT 1 206 10 "\nend proc:" }{MPLTEXT 1 206 0 "" }}} {PARA 205 "" 0 "" {TEXT 212 0 "" }}{EXCHG {PARA 202 "> " 0 "" {MPLTEXT 1 206 20 "absolutevalue(-5.6);" }{MPLTEXT 1 206 0 "" }}{PARA 203 "" 1 "" {XPPMATH 20 "6#$\"#c!\"\"" }{TEXT 207 0 "" }}}{EXCHG {PARA 201 "" 0 "" {TEXT 203 24 "What happens if you try " }{TEXT 205 17 "absolutevalue(-5)" }{TEXT 203 1 "?" }{TEXT 203 0 "" }}}{PARA 205 " " 0 "" {TEXT 213 9 "EXERCISES" }{TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 214 98 "In the exercises for this and future labs, you will some times be asked to write a procedure that \"" }{TEXT 214 8 "returns\"" }{TEXT 214 117 " an object and sometimes asked to \"display\" or \"ind icate\" something. This is the difference that was mentioned above." } {TEXT 212 0 "" }{TEXT 212 1 "\n" }}{PARA 205 "" 0 "" {TEXT 214 47 "1. \+ Write a procedure that takes three integers " }{TEXT 215 1 "x" }{TEXT 214 2 ", " }{TEXT 215 1 "y" }{TEXT 214 6 ", and " }{TEXT 215 1 "z" } {TEXT 214 43 " as its arguments and returns the value of " }{TEXT 215 4 "xy+z" }{TEXT 214 1 "." }{TEXT 214 0 "" }{TEXT 214 60 "\n2. Write a \+ procedure that takes two floating-point numbers " }{TEXT 215 1 "a" } {TEXT 214 5 " and " }{TEXT 215 1 "b" }{TEXT 214 34 " as its arguments \+ and returns the " }{TEXT 215 1 "b" }{TEXT 214 11 "th root of " }{TEXT 215 1 "a" }{TEXT 214 1 "." }{TEXT 214 0 "" }{TEXT 214 35 "\n3. Write a procedure that takes a " }{TEXT 216 6 "string" }{TEXT 214 156 " (any \+ sequence of characters enclosed in double quotes, such as \"walrus\") \+ as its argument and returns the third character of that string. Hint: \+ look up the " }{TEXT 216 9 "substring" }{TEXT 214 26 " command in the \+ Help menu." }{TEXT 214 0 "" }{TEXT 214 143 "\n4. Write a procedure tha t takes a floating-point number as its argument and then indicates whe ther that number is positive, negative, or zero." }{TEXT 214 0 "" } {TEXT 214 110 "\n5. Write a procedure that takes two integers as its a rguments and returns the value of the larger of the two." }{TEXT 214 0 "" }{TEXT 214 216 "\n6. Write a procedure that takes three floating- point numbers as its arguments and returns the value of the largest of the three. Note: this may require some techniques slightly beyond tho se taught in the lab so far." }{TEXT 214 0 "" }{TEXT 214 67 "\n7. Writ e a procedure that takes a positive integer (variable type " }{TEXT 216 6 "posint" }{TEXT 214 81 ") as its argument and then displays eith er \"prime\" or \"composite\" as appropriate." }{TEXT 212 0 "" }} {PARA 205 "" 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 0 "" }} {PARA 205 "" 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 0 "" }} {PARA 205 "" 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 0 "" }} {PARA 205 "" 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 0 "" }} {PARA 205 "" 0 "" {TEXT 212 8 " " }{TEXT 212 0 "" }}{PARA 205 " " 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT 212 0 "" }}{PARA 205 " " 0 "" {TEXT 212 0 "" }}{PARA 205 "" 0 "" {TEXT -1 0 "" }}}{MARK "0 0 \+ 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }