;; profit: number -> number
;; to compute the profit as the difference between
;; revenue and costs at some given ticket-price
(define (profit ticket-price)
(- (revenue ticket-price)
(cost ticket-price)))
;; revenue: number number -> number
;; to compute the revenue, given ticket-price
(define (revenue ticket-price)
(* (attendees ticket-price) ticket-price))
;; cost: number -> number
;; to compute the cost, given ticket-price
(define (cost ticket-price)
(+ 180
(* 0.04 (attendees ticket-price))))
;; attendees: number -> number
;; to compute the number of attendees,
;; given ticket-price
(define (attendees ticket-price)
(+ 120
(* (/ 15 0.10) (- 5.00 ticket-price))))
profit 関数
revenue 関数
cost 関数
attendees 関数
38