Showing posts with label How to Design Programs. Show all posts
Showing posts with label How to Design Programs. Show all posts

Monday, March 12, 2007

How to Design Programs - 3.3 Finger Exercises on Composing Functions

Exercise 3.3.1.

The United States uses the English system of (length) measurements. The rest of the world uses the metric system. So, people who travel abroad and companies that trade with foreign partners often need to convert English measurements to metric ones and vice versa.

Here is a table that shows the six major units of length measurements of the English system:

Englishmetric

1 inch
=2.54cm

1 foot
=12in.

1 yard
=3ft.
1 rod=5(1/2)yd.
1 furlong=40rd.
1 mile=8fl.

Develop the functions inches->cm, feet->inches, yards->feet, rods->yards, furlongs->rods, and miles->furlongs.

Then develop the functions feet->cm, yards->cm, rods->inches, and miles->feet.

Hint: Reuse functions as much as possible. Use variable definitions to specify constants.

Solution

;; inches->cm : number -> number
;; convert inches into cm
(define (inches->cm inches)
  (* inches INCH->CM))

;; feet->inches : number -> number
;; convert feet into inches
(define (feet->inches feet)
  (* feet FOOT->INCH))

;; yards->feet : number -> number
;; convert yards into feet
(define (yards->feet yards)
  (* yards YARD->FOOT))

;; rods->yards : number -> number
;; convert rods into yards
(define (rods->yards rods)
  (* rods ROD->YARD))

;; furlongs->rods : number -> number
;; convert furlongs into rods
(define (furlongs->rods furlongs)
  (* furlongs FURLONG->ROD))

;; miles->furlongs : number -> number
;; convert miles into furlongs
(define (miles->furlongs miles)
  (* miles MILE->FURLONG))

(define MILE->FURLONG 8)
(define FURLONG->ROD 40)
(define ROD->YARD 5.5)
(define YARD->FOOT 3)
(define FOOT->INCH 12)
(define INCH->CM 2.54)

;; feet->cm : number -> number
;; convert feet into cm
(define (feet->cm feet)
  (inches->cm
   (feet->inches feet)))

;; yards->cm : number -> number
;; convert yards into cm
(define (yards->cm yards)
  (feet->cm
   (yards->feet yards)))

;; rods->inches : number -> number
;; convert rods into inches
(define (rods->inches rods)
  (feet->inches
   (yards->feet
    (rods->yards rods))))

;; miles->feet : number -> number
;; convert miles into feet
(define (miles->feet miles)
  (yards->feet
   (rods->yards
    (furlongs->rods
     (miles->furlongs miles)))))

Exercise 3.3.2.

Develop the program volume-cylinder. It consumes the radius of a cylinder's base disk and its height; it computes the volume of the cylinder.

Solution

;; volume-cylinder : number number -> number
;; calculate volume of cylinder
;; example: (volume-cylinder 4 4) -> 201.06176
(define (volume-cylinder radius height)
  (*
   (area-circle radius)
   height))

;; area-circle : number -> number
;; calculate area of circle
;; example: (area-circle 4) -> 50.26544
(define (area-circle radius)
  (* PI (sqr radius)))

(define PI 3.14159)

Exercise 3.3.3.

Develop area-cylinder. The program consumes the radius of the cylinder's base disk and its height. Its result is the surface area of the cylinder.

Solution

;; area-cylinder : number number -> number
;; calculate surface area of cylinder
;; example: (area-cylinder 4 4) -> 201.06176
(define (area-cylinder radius height)
  (+
   (* 2
      (area-circle radius))
   (* height
      (circumference-circle radius))))

;; circumference-circle : number -> number
;; calculate circumference of circle
;; example: (circumference-circle 4) -> 25.13272
(define (circumference-circle radius)
  (* 2
     (* PI radius)))

;; area-circle : number -> number
;; calculate area of circle
;; example: (area-circle 4) -> 50.26544
(define (area-circle radius)
  (* PI (sqr radius)))

(define PI 3.14159)

Exercise 3.3.4.

Develop the function area-pipe. It computes the surface area of a pipe, which is an open cylinder. The program consumes three values: the pipe's inner radius, its length, and the thickness of its wall.

Develop two versions: a program that consists of a single definition and a program that consists of several function definitions. Which one evokes more confidence?

Solution

;; area-pipe number number number -> number
;; calculate surface area of open pipe
;; example: (area-pipe-multi 3 5 0.1) -> 195.4697298
(define (area-pipe-multi inner-radius length thickness-wall)
  (+
   (area-pipe-wall inner-radius length)
   (area-pipe-wall
    (+ inner-radius thickness-wall)
    length)
   (*
    2
    (-
     (area-circle (+ inner-radius thickness-wall))
     (area-circle inner-radius)))))

;; area-pipe-wall : number number -> number
;; calculate area of pipe wall
;; examples:
;; (area-pipe-wall 3 5) -> 94.2477
;; (area-pipe-wall 3.1 5) -> 97.38929
(define (area-pipe-wall radius length)
  (* (circumference-circle radius)
     length))

;; area-circle : number -> number
;; calculate area of circle
;; examples:
;; (area-circle 3) -> 28.27431
;; (area-circle 3.1) -> 30.1906799
(define (area-circle radius)
  (* PI (sqr radius)))

;; circumference-circle : number -> number
;; calculate circumference of circle
;; examples:
;; (circumference 3) -> 18.84954
;; (circumference 3.1) -> 19.477858
(define (circumference-circle radius)
  (* 2 PI radius))

(define PI 3.14159)

;; area-pipe : number number number -> number
;; calculate surface area of open pipe
(define (area-pipe radius length thickness-wall)
  (+
   (* 2 3.14159 radius length)
   (* 2 3.14159
      (+ radius thickness-wall)
      length)
   (* 2
      (-
       (* 3.14159 (sqr
                   (+ radius thickness-wall)))
       (* 3.14159 (sqr radius))))))

Obviously, the solution with the multiple definitions evokes more confidence, because you can develop a higher order function before getting into the details of the lower order functions.

Exercise 3.3.5.

Develop the program height, which computes the height that a rocket reaches in a given amount of time. If the rocket accelerates at a constant rate g, it reaches a speed of g * t in t time units and a height of 1/2 * v * t where v is the speed at t.

Solution

;; height : number -> number
;; calculate height of rocket at certain time
;; example: (height 3) -> 45
(define (height time)
  (* 0.5 (speed time) time))

;; speed : number -> number
;; calculate speed of rocket at certain time
;; example: (speed 3) -> 30
(define (speed time)
  (* G time))

(define G 10)

Exercise 3.3.6.

Recall the program Fahrenheit->Celsius from exercise 2.2.1. The program consumes a temperature measured in Fahrenheit and produces the Celsius equivalent.

Develop the program Celsius->Fahrenheit, which consumes a temperature measured in Celsius and produces the Fahrenheit equivalent.

Now consider the function

;; I : number -> number
;; to convert a Fahrenheit temperature to Celsius and back
(define (I f)
  (Celsius->Fahrenheit (Fahrenheit->Celsius f)))

Evaluate (I 32) by hand and using DrScheme's stepper. What does this suggest about the composition of the two functions?

Solution

;; Fahrenheit->Celsius number -> number
;; examples:
;; (Fahrenheit->Celsius 32) -> 0
;; (Fahrenheit->Celsius 212) -> 100
(define (Fahrenheit->Celsius F)
  (* (- F 32) (/ 5 9)))

;; Celsius->Fahrenheit number -> number
;; examples:
;; (Celsius->Fahrenheit 0) -> 32
;; (Celsius->Fahrenheit 100) -> 212
(define (Celsius->Fahrenheit C)
  (+ (* C (/ 9 5)) 32))

;; I : number -> number
;; to convert a Fahrenheit temperature to Celsius and back
(define (I f)
  (Celsius->Fahrenheit (Fahrenheit->Celsius f)))

(I 32) is Celsius->Fahrenheit applied to (Fahrenheit-Celsius 32)

(Fahrenheit-Celsius 32)
evaluates to
(/ (* (- 32 32) 5) 9)
(/ (* 0 5) 9)
(/ 0 9)
0


(Celsius-Fahrenheit 0)
evaluates to
(+ (/ (* 0 9) 5) 32)
(+ (/ 0 5) 32)
(+ 0 32)
32


DrScheme's Stepper:

(I 32)

(Celsius->Fahrenheit
  (Fahrenheit->Celsius 32))


(Celsius->Fahrenheit
  (Fahrenheit->Celsius 32))

(Celsius->Fahrenheit
  (* (- 32 32) (/ 5 9)))

(Celsius->Fahrenheit
  (* (- 32 32) (/ 5 9)))

(Celsius->Fahrenheit
  (* 0 (/ 5 9)))

(Celsius->Fahrenheit
  (* (/ 5 9)))

(Celsius->Fahrenheit (* 0 5/9))

(Celsius->Fahrenheit (* 0 5/9))

(Celsius->Fahrenheit 0)

(Celsius->Fahrenheit 0)

(+ (* 0 (/ 9 5)) 32)

(+ (* 0 (/ 9 5)) 32)

(+ (* 0 9/5) 32)

(+ (* 0 9/5) 32)

(+ 0 32)

(+ 0 32)

32

The constants 32 and 5/9 could be incorporated in both as variables.

How to Design Programs - 3.2 Variable Definitions

;; How to design a program
(define (profit ticket-price)
  (- (revenue ticket-price)
     (cost ticket-price)))

(define (revenue ticket-price)
  (* (attendees ticket-price) ticket-price))

(define (cost ticket-price)
  (+ 180
     (* 0.04 (attendees ticket-price))))

(define (attendees ticket-price)
  (+ 120
     (* (/ 15 .10) (- 5.00 ticket-price))))

Exercise 3.2.1.

Provide variable definitions for all constants that appear in the above profit program and replace the constants with their names.

Solution

;;; How to design a program
(define (profit ticket-price)
  (- (revenue ticket-price)
     (cost ticket-price)))

(define (revenue ticket-price)
  (* (attendees ticket-price) ticket-price))

(define (cost ticket-price)
  (+ FIXED-COST
     (* COST-PER-ATTENDEE (attendees ticket-price))))

(define (attendees ticket-price)
  (+ ATTENDEES-AT-BASE-PRICE
     (*
      (/
       MORE-ATTENDEES-PER-PRICE-DECREASE
       PRICE-DECREASE)
      (- BASE-PRICE ticket-price))))

(define FIXED-COST 180)
(define COST-PER-ATTENDEE 0.04)
(define ATTENDEES-AT-BASE-PRICE 120)
(define BASE-PRICE 5.00)
(define MORE-ATTENDEES-PER-PRICE-DECREASE 15)
(define PRICE-DECREASE .10)

Saturday, March 10, 2007

How to Design Programs - 3.1 Composing Functions

Consider the following problem:

Imagine the owner of a movie theater who has complete freedom in setting ticket prices. The more he charges, the fewer the people who can afford tickets. In a recent experiment the owner determined a precise relationship between the price of a ticket and average attendance. At a price of $5.00 per ticket, 120 people attend a performance. Decreasing the price by a dime ($.10) increases attendance by 15. Unfortunately, the increased attendance also comes at an increased cost. Every performance costs the owner $180. Each attendee costs another four cents ($0.04). The owner would like to know the exact relationship between profit and ticket price so that he can determine the price at which he can make the highest profit.

Exercise 3.1.1.

The next step is to make up examples for each of the functions. Determine how many attendees can afford a show at a ticket price of $3.00, $4.00, and $5.00. Use the examples to formulate a general rule that shows how to compute the number of attendees from the ticket price. Make up more examples if needed.

Solution

  • 120 people can afford 5 dollar per ticket
  • decreasing the ticket price by 0.1 dollar increases attendance by 15
    or:
    decreasing the ticket price by 1 dollar increases attendance by 150

    or:
    for every dollar less, 150 more people will attend
  • if the ticket price is decreased by 5 dollar, 870 people will attend
    so:
    number of people = 870 - (price in dollars) * (150 per dollar)
priceattendees
5120
4270
3420
2570
1720
0870

Exercise 3.1.2.

Use the results of exercise 3.1.1 to determine how much it costs to run a show at $3.00, $4.00, and $5.00. Also determine how much revenue each show produces at those prices. Finally, figure out how much profit the monopolistic movie owner can make with each show. Which is the best price (of these three) for maximizing the profit?

Solution

  • the costs are 180 dollars, plus 0.04 dollars timers the number of attendees
  • the revenue is the number of attendees times the ticket price
  • profit is revenue minus cost
priceattendeescostrevenueprofit
5120184.8600415.2
4270190.81080889.2
3420196.812601063.2
2570202.81140937.2
1720208.8720511.2
0870214.80-214.8

$3.00 is the best price of the three.

;; How to design a program
(define (profit ticket-price)
  (- (revenue ticket-price)
    (cost ticket-price)))

(define (revenue ticket-price)
  (* (attendees ticket-price) ticket-price))

(define (cost ticket-price)
  (+ 180
    (* .04 (attendees ticket-price))))

(define (attendees ticket-price)
  (+ 120
    (* (/ 15 .10) (- 5.00 ticket-price))))
;; How not to design a program
(define (profit price)
   (- (* (+ 120
            (* (/ 15 .10)
               (- 5.00 price)))
         price)
      (+ 180
        (* .04
          (+ 120
             (* (/ 15 .10)
                (- 5.00 price)))))))

Exercise 3.1.3.

Determine the profit that the movie owner makes at $3.00, $4.00, and $5.00 using both program definitions. Make sure that the results are the same as those predicted in exercise 3.1.2.

Solution

;; How to design a program
> (profit 5)
415.2
> (profit 4)
889.2
> (profit 3)
1063.2
;; How not to design a program
> (profit 5)
415.2
> (profit 4)
889.2
> (profit 3)
1063.2

The results are the same as before.

Exercise 3.1.4.

After studying the cost structure of a show, the owner discovered several ways of lowering the cost. As a result of his improvements, he no longer has a fixed cost. He now simply pays $1.50 per attendee.

Modify both programs to reflect this change. When the programs are modified, test them again with ticket prices of $3.00, $4.00, and $5.00 and compare the results.

Solution

;; How to design a program
(define (profit ticket-price)
  (- (revenue ticket-price)
    (cost ticket-price)))

(define (revenue ticket-price)
  (* (attendees ticket-price) ticket-price))

(define (cost ticket-price)
  (* 1.50 (attendees ticket-price)))

(define (attendees ticket-price)
  (+ 120
    (* (/ 15 .10) (- 5.00 ticket-price))))
> (profit 5)
420
> (profit 4)
675
> (profit 3)
630
;; how not to design a program
(define (profit price)
   (- (* (+ 120
            (* (/ 15 .10)
               (- 5.00 price)))
         price)
      (* 1.50
        (+ 120
          (* (/ 15 .10)
             (- 5.00 price))))))
> (profit 5)
420
> (profit 4)
675
> (profit 3)
630

The results for both methods are the same. Compared to the results in exercise 3.1.3, a ticket price of $4.00 is more favorable, instead of the earlier $3.00.

Friday, March 2, 2007

How to Design Programs - 2.4 Errors

Here are the exercises and my solotions of Section 2.4, called "Errors", in How to Design Programs.

Exercise 2.4.1.

Evaluate the following sentences in DrScheme, one at a time:

(+ (10) 20)
(10 + 20)
(+ +)

Read and understand the error messages.

Solution

> (+ (10) 20)
function call: expected a defined name or a primitive operation name after an open parenthesis, but found a number

The number 10 shouldn't be between parentheses here.

> (10 + 20)
function call: expected a defined name or a primitive operation name after an open parenthesis, but found a number

The number 10 is at the wrong position, it should read (+ 10 20)

> (+ +)
+: this primitive operator must be applied to arguments; expected an open parenthesis before the primitive operator name

There should be a value or expression at that position (followed by a second value or expression).

Exercise 2.4.2.

Enter the following sentences, one by one, into DrScheme's Definitions window and click Execute:

(define (f 1)
  (+ x 10))

(define (g x)
  + x 10)

(define h(x)
  (+ x 10))

Read the error messages, fix the offending definition in an appropriate manner, and repeat until all definitions are legal.

Solution

(define (f 1)
  (+ x 10))
__________

define: expected a name for the function's 1st argument, but found a number

The faulty 1 should be replaced by a x:

(define (f x)
  (+ x 10))

(define (g x)
  + x 10)
__________

define: expected only one expression for the function body, but found at least one extra part

There is a open parenthesis missing, and a close parenthesis should be added to the end:

(define (g x)
  (+ x 10))

Exercise 2.4.3.

Evaluate the following grammatically legal Scheme expressions in DrScheme's Interactions window:

(+ 5 (/ 1 0))

(sin 10 20)

(somef 10)

Read the error messages.

Solution

> (+ 5 (/ 1 0))
/: division by zero
> (sin 10 20)
sin: expects 1 argument, given 2: 10 20
> (somef 10)
reference to an identifier before its definition: somef

Exercise 2.4.4.

Enter the following grammatically legal Scheme program into the Definitions window and click the Execute button:

(define (somef x)
  (sin x x))

Then, in the Interactions window, evaluate the expressions:

(somef 10 20)

(somef 10)

and read the error messages. Also observe what DrScheme highlights.

Solution

> (somef 10 20)
somef: this procedure expects 1 argument, here it is provided 2 arguments

There should only be one argument, e.g. (somef 10)

(define (somef x)
  (sin x x))

__________

> (somef 10)
sin: expects 1 argument, given 2: 10 10

The sin primitive accepts only one argument, it should read (sin x) in the definition.

How to Design Programs - 2.3 Word Problems

Here are the exercises and my solotions of Section 2.3, called "Word Problems", in How to Design Programs.

Exercise 2.3.1.

Utopia's tax accountants always use programs that compute income taxes even though the tax rate is a solid, never-changing 15%. Define the program tax, which determines the tax on the gross pay.

Also define netpay. The program determines the net pay of an employee from the number of hours worked. Assume an hourly rate of $12.

Solution

The gross pay is

gross = 12 * h

the tax is 15% of the gross pay, or

tax = gross * 0.15

The net pay is gross pay minus tax, or

netpay = grosspay - tax

This means that both tax and net pay are depending on the number of hours worked.

(define (grosspay h)
  (* h 12))

(define (tax h)
  (* (grosspay h) 0.15))

(define (netpay h)
  (- (grosspay h) (tax h)))

Exercise 2.3.2.

The local supermarket needs a program that can compute the value of a bag of coins. Define the program sum-coins. It consumes four numbers: the number of pennies, nickels, dimes, and quarters in the bag; it produces the amount of money in the bag.

Solution

This is really easy:

value = pennies * 1 + nickels * 5 + dimes * 10 + quorters * 25

or in DrScheme:

(define (sum-coins p n d q)
  (+ p (+ (* n 5) (+ (* d 10) (* q 25)))))

Exercise 2.3.3.

An old-style movie theater has a simple profit function. Each customer pays $5 per ticket. Every performance costs the theater $20, plus $.50 per attendee. Develop the function total-profit. It consumes the number of attendees (of a show) and produces how much income the attendees produce.

Solution

Each performances brings in a revenue of:

revenue = attendees * 5

The performance costs are:

cost = 20 + attendees * 0.5

The profit is:

profit = revenue - cost

or in DrScheme:

(define (revenue n)
  (* n 5))
(define (cost n)
  (+ 20 (* n 0.5)))
(define (total-profit n)
  (- (revenue n) (cost n)))

Thursday, March 1, 2007

How to Design Programs - 2.2 Variables and Programs

Here are the exercises and my solotions of Section 2.2, called "Variables and Programs", in How to Design Programs.

Exercise 2.2.1.

Define the program Fahrenheit->Celsius, which consumes a temperature measured in Fahrenheit and produces the Celsius equivalent. Use a chemistry or physics book to look up the conversion formula.

solution

I found a formula here:

(F-32)*5/9 = C

Expressing this in DrScheme:

(define (Fahrenheit->Celsius F)
  (* (- F 32) (/ 5 9)))

Exercise 2.2.2.

Define the program dollar->euro, which consumes a number of dollars and produces the euro equivalent. Use the currency table in the newspaper to look up the current exchange rate.

Solution

Type this into Google

1 dollar in euros

The result was:

1 U.S. dollar = 0.757002271 Euros

So we need to multiply the amount of dollars with 0.757002271:

(define (dollar->euro D)
  (* D 0.757002271))

Exercise 2.2.3.

Define the program triangle. It consumes the length of a triangle's side and the perpendicular height. The program produces the area of the triangle. Use a geometry book to look up the formula for computing the area of a triangle.

Solution

According to this math page, the area of a triangle is calculated as follows:

A = (w * h) / 2

This means expressed in DrSchema, as a function:

(define (triangle w h)
  (/ (* w h) 2))

Exercise 2.2.4.

Define the program convert3. It consumes three digits, starting with the least significant digit, followed by the next most significant one, and so on. The program produces the corresponding number. For example, the expected value of

(convert3 1 2 3)

is 321. Use an algebra book to find out how such a conversion works.

Solution

According to this page, a number like 123 can be expressed as follows:

123 = 1 * 100 + 2 * 10 + 3

So, if the digits are given in the reverse order, 3, 2, 1, then the first value should be multiplied by 100, the second with 10, and the products should be added together with the third digit. This gives the following program:

(define (convert3 n1 n2 n3)
  (+ n1 (+ (* 10 n2) (* 100 n3))))

Exercise 2.2.5.

A typical exercise in an algebra book asks the reader to evaluate an expression like

for n = 2, n = 5, and n = 9. Using Scheme, we can formulate such an expression as a program and use the program as many times as necessary. Here is the program that corresponds to the above expression:

(define (f n)
  (+ (/ n 3) 2))

First determine the result of the expression at n = 2, n = 5, and n = 9 by hand, then with DrScheme's stepper.

Also formulate the following three expressions as programs:

  1. n2 + 10
  2. (1/2) · n2 + 20
  3. 2 - (1/n)

Determine their results for n = 2 and n = 9 by hand and with DrScheme.

Solution

For n = 2, n = 5, n = 9,

is 2(2/3), 3(2/3), and 5. With Stepper the results are 8/3, 11/3, and 5.

For n = 2 and n = 9 in n2 + 10, the results are 14 and 91.

(define (g n)
  (+ (sqr n) 10))

gives:

> (g 2)
14
> (g 9)
91

For n = 2 and n = 9 in (1/2) · n2 + 20, the results are 22 and 60(1/2).

(define (h n)
  (+ (* 1/2 (sqr n)) 20))

gives:

> (h 2)
22
> (h 9)
60.5

For n = 2 and n = 9 in 2 - (1/n), the results are 1(1/2) and 1(8/9).

(define (j n)
  (- 2 (/ 1 n)))

gives:

> (j 2)
1.5
> (j 9)
1.8

which are all correct.

How to Design Programs - 2.1 Numbers and Arithmetic

Here are the exercises and my solotions of Section 2.1, called "Numbers and Arithmetic", in How to Design Programs.

Exercise 2.1.1.

Find out whether DrScheme has operations for squaring a number; for computing the sine of an angle; and for determining the maximum of two numbers.

Solution:

In the Help Desk, Manuals, Beginning Student Language, there are these entries:

sqr : (num -> num)

purpose:
to compute the square of a number

sin : (num -> num)

purpose:
to compute the sine of a number (radians)

pi : real

purpose:
the ratio of a circle's circumference to its diameter

max : (real real ... -> real)

purpose:
to determine the largest number

Now, this would mean the following:

(define (square n)
  (sqr n))

(define (sin-angle a)
  (sin (* (* 2 pi) (/ a 360))))

(define (maximum n1 n2)
  (max n1 n2))

Running this code gives the following output:

> (square 5)
25
> (sin-angle 90)
#i1.0
> (sin (/ pi 2))
#i1.0
> (sin-angle 180)
#i1.2246467991473532e-16
> (sin pi)
#i1.2246467991473532e-16
> (maximum 3 5)
5
> (maximum -3 -5)
-3

So, there is the primitive sqr to calculate the square of a number, you need to use a formula with pi to convert from angles to radian, and there is the primitive max to calculate the maximum of two numbers.

Exercise 2.1.2.

Evaluate (sqrt 4), (sqrt 2), and (sqrt -1) in DrScheme. Then, find out whether DrScheme knows an operation for determining the tangent of an angle.

Solution:

> (sqrt 4)
2
> (sqrt 2)
#i1.4142135623730951
> (sqrt -1)
0+1i
> (tan (* (* 2 pi) (/ 45 360)))
#i0.9999999999999999

Wednesday, February 28, 2007

Using DrScheme

Before starting the How to Design Programs course, it is important to get accustomed with the program DrScheme by using the Help menu. You should definitely start by installing the programming environment DrScheme on you computer. The online manuals are somewhat outdated, because they are based on older versions of DrScheme. I advice against using those, and rather use the built-in material, which is much more recent.

For instance, if you--like me--want to know what operators are available for the Student beginner version, look it up in:

Help -> Help Desk -> Manuals -> Beginning Student Language -> PRIM OPs

The Help Desk is a searchable library, which means it has it's own search function. If you have any questions, you should use the Help menu to try to find an answer. You probably will find it, because the Help Desk is pretty extensive.