
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

CS1371 - Computing for Engineers Test 1 Version D September 20th, 2006
Write a function called busFare that returns the type of ticket issued and the fare for that ticket. The function takes in the number of stops that the person wishes to travel and calculates the type of ticket issued and the fare according to the following classifications: If the number of stops >=1 and <=3: Type: ‘Type 1’ Fare: $1. If the number of stops >=4 and <=6: Type: ‘Type 2’ Fare: $2. If the number of stops >=7 and <=10: Type: ‘Type 3’ Fare: $3. If the number of stops >=11 Type: ‘Type 4’ Fare: $4. Example: [type, fare] = busFare(7) Returns: type = ‘Type 3’ fare = 3 Page 6 of 9