Exercise 3.2.1: (back)
;; Constants
(define PERFORMANCE-COST 180)
(define ATTENDEE-COST 0.04)
(define PEOPLE-ATTEND 120)
(define INCREASE-ATTENDANCE 15)
(define PRICE-DECREASE 0.10)
(define PRICE-PER-TICKET 5.00)
;; 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)
(+ PERFORMANCE-COST
(* ATTENDEE-COST (attendees ticket-price))))
(define (attendees ticket-price)
(+ PEOPLE-ATTEND
(* (/ INCREASE-ATTENDANCE PRICE-DECREASE) (- PRICE-PER-TICKET ticket-price))))