[plt-scheme] HtDP > Chapter 2 > Exercise 2.3.3.

From: Mr. Watson (graphettion at gmail.com)
Date: Thu Jun 26 18:30:43 EDT 2008

Hello,

The problem says,

"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."

I understand the problem but I cannot get it to work (not calculate
correctly) in DrScheme.

Here is my working progress:

(define(total-profit attendee)
  (- 0
   (- 20 0
    (* 0.5 attendee)
    (+ 0
     (* 5 attendee)))))

Any ideas on what I am doing wrong? I might be miscalculating so tell
me if its right.

Thank you,


Posted on the users mailing list.