(* use the CIS 120 testing library *) ;; open Assert (* attendees at a given price *) let attendees (price:int) : int = (-15 * price)/10 + 870 let test () : bool = (attendees 500) = 120 ;; run_test "attendees @ $5.00" test let test () : bool = (attendees 490) = 120 + 15 ;; run_test "attendees @ $4.90" test (* price is cost of a ticket in cents *) let profit (price:int) : int = let revenue = price * (attendees price) in let cost = 18000 + 4 * (attendees price) in revenue - cost let profit_500 : int = let price = 500 in let attendees = 120 in let revenue = price * attendees in let cost = 18000 + 4 * attendees in revenue - cost let test () : bool = (profit 500) = profit_500 ;; run_test "profit at $5.00" test