Write a function bridge(car_type, ez_pass) that has two parameters, car_type that could be 1 or 2, 1 for regular car and 2 for track or bus, and ez_pass indicator, that could be 0 ( no ez pass) or 1 (there is ez pass). The function returns the cost to cross the bridge. Use Tables 1 and 2.
CAR TYPE: | COST |
1 : | $5 |
2 : | $6 |
CAR TYPE: | COST |
1 : | $4.5 |
2 : | $4.5 |
Suppose, TWO people in the family are crossing the bridge TWICE per day (to go to work and come back from work) and the payment is required in both directions. Write a program that reads car type and ez pass indicator for each family member and calculates the total cost of work commute per family. ASSUME THAT INPUT IS VALID!
Example: Input: 1 1 2 0 Output: 21 dollars (explanation: one way cost 10.5 = 4.5+6, and both ways will cost 10.5*2 = 21 dollars)