## Problems 11 - 31

9/10

Intro to Functions

• connection to mathematical functions  f(x) = 2x - 7

• arithmetic function example

• string function example

• image function example

intro to functions video  (review of built-in functions) (area of triangle)  (login name : first initial and first 3 letters of last name) (frame image)

Exercises 6 - 9 due

ppt #5 - functions  (Brittany Wenger)  (area rectangle)  (write area circumference of a circle)  (three-copies of a word)  (remove end letters)  (pendulum swing)

• start working on functions problems, 11 - 20

• 11  write the header  (define (distance-from-origin  x  y) ... the expression from problem #1 ...)

• 12  (define (cube-vol  side-len)  ... ) write the expression to find the volume of  a cube.  Also write surface-area

• 13  returns the first character of a string

• 15  (define (sleep-in  weekday  vacation) ..alternate to problem #7 ... )

OR

(define (go-2-mall  friday  sunny) ...from problem #7 ... )

9/12

Functions Intro. continued

• work on problems 11 – 20

9/14

Functions Intro. finish up

• finish problems 11 - 20

Rock Paper Scissors part 1

9/18

Theater Problems

• problems 11 - 20 due

• Copy these programs to the definition window of DrRacket

• 21 - 26 - write each result of the stepper after a semi colon. There may be several steps. Problems 21 & 25 have an extra part to answer. Run the function in problem 25 with a tall image, wide image, and square image. If any of those fail to give the correct answer, then step through and use the stepper to locate the error.

ex 21 - 26 video

• The Theater Program consists of 4 programs ; attendees, revenue, cost, & profit.

• 27  replace all numbers with constants. For example   (define  people@\$5  120)

• 28  Students overlook finding the profit to the nearest dime.

• 29  Currently, the theater owner pays \$180 + 4 cents per person in costs.  If no one shows up, they are out \$180.  If 500 people show up, \$200.  A new cleaning company offers to do it for \$1.50 per person.  Change the _?_ program to reflect this change.

• 30 replace the expression that uses constants with a constant. Video

• ppt Theater Problems 27 - 30

• video Theater Problems

9/20

9/24

Work on Theater problems

• examples of animations

9/26

Finish Theater problems

Batch i/o (input/output)

• 31 Create a text file, that you can open in Notepad, that contains the lottery form letter.

• The "input" files may be changed to:

• in-fst.txt  ( 1. adding .txt makes it easier to use on Windows machines. The file will just contain your first name)

• in-lst.txt   ( contains just your last name)

• in-signature.txt  ( contains your full name)

• Skip 32 & 33