; Use the data definition of Transportation for these three steps. ; STEP 1: Write some data examples of Transportation. ; STEP 2: Write the template for functions which consume Transportation inputs. ; STEP 3: Use the design recipe and the template you just wrote to design the ; programs described below. (define-struct taxi( distance fair)) (define-struct bus( route distance fair)) (define-struct walk( distance)) ; A Transportation is one of ; - (make-taxi Number Number) ; - (make-bus String Number Number) ; - (make-walk Number) ; Data Examples: ; WRITE THESE! ; Template: ; WRITE THIS! ; Program 1: total-cost ; Finds the cost for traveling a distance ; - Taxis cost 2 dollars to start, plus the fair times the distance ; - Buses cost the fair no matter what the distance is ; - Walking costs nothing if distance is under 8 miles, otherwise ; it costs 1 dollar for a drink every 8 miles ; Program 2: total-time ; Finds the time to travel a distance ; - Taxis take the distance divided by 25mph ; - Buses take the distance divided by 10mph unless the route is ; an "express" which takes distance divided by 15mph ; - Walking takes the distance divided by 5mph ; Program 3: cost-per-distance ; Finds the cost per unit of travel ; - Taxis, Buses, and Walking take the total-cost divided by the distance