Saturday, July 31, 2010

Auto Fare Converter


New Auto fare in Bangalore is in effect from Aug 1, 2010. But, Autos have been given 2 month time period to change their meters.

As a result, commuters are expected to know the fare conversion from old to new. Either trust the Auto Driver or have a print of the fare conversion table published.

So I quickly wrote a mobile application to do the conversion. I wrote 2 versions, one android version and other Java ME (MIDP 2.0) application.




Here are the links to the application installables





Application Usage:
  1. Enter the current fare in the meter.
  2. Click Convert button.
  3. The amount you need to pay, the new fare, will be shown.


Monday, July 26, 2010

BMTC Bus Ticket Cost Calculation

In a recent travel through BMTC bus to my office, I was involved in a big fight between another software engineer and the bus conductor on - how the ticket price was calculated? The software engineer did not know Kannada and the bus conductor could explain in the English. I served as the translator in that heated argument :)... here is the info how the ticket price is calculated.

Note: The calculation is performed by the ticketing machine given to the bus conductor so the conductor cannot cheat you!

BMTC divides the routes into stages. Following is the 'Fare Table' of BMTC Bus No 45. You can get the 'Fare Table' for your route from the conductor....Please Ask!













FARE TABLE-010
StageNameFare
1KAMAKYA0.00
2KATTRIGUPPE5.00
3HOSAKERE HALLI9.00
4BANK COLONY10.00
5GANESH BHAVAN13.00
6CHAMARAJPET15.00
7GOODS ROAD16.00
8KBS16.00


Now the stage you climb the bus is the Stage 1 for you and of course the stage you get off is the last stage for you. Lets see the following examples of fare calculation with the previous assumption.

Fare from

  • KAMAKYA to KBS = Stage 8 - Stage 0 = 8 Stages crossed = Rs 16
  • BANK COLONY to GOODS Road = Stage 7 - Stage 4 = 3 Stages Crossed = Rs 9
  • GOODS ROAD to KBS = Stage 8 - Stage 7 = 1 Stage crossed = Rs 5
Algorithmically,


List stageList=[KAMKYA...KBS]
List fareList=[0..16]
int start= stageList.indexOf[YOUR START STAGE]
int end = stageList.indexOf[YOUR END STAGE]
Fare= fareList[end-start]

Hope the calculation is clear!