3. A taxi charges an amount of 25.00 pesos for the first 300 meters and a fix rate of 15.00 pesos for every 200 meters thereafter. Any distance covering the next 200 meters zone (or less) is still charged 15.00. Create a program that would input the DISTANCE in kilometers that the taxi traveled and output the COST of the trip.jeffrey on turbo C

WaltP commented: How does this post help the ellenski solve his/her problem? And 2.5 years too late? -2
Salem commented: Dimwit thread hijacker with the "plzdomyhomework" pith - just go away moron. -4

This is a simnple grade-school level math problem.

amount = 25
distance -= 300
if distance is greater than 0 then amount = amount + 15 * ((distance % 200)+1)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.