Friday, February 1, 2019

Taxi Fare

  • Problem Description

    In a particular jurisdiction in India after implementing GST the taxi fares are altered. Taxi fares consist of a base fare of 200 and GST tax as 4% of base fare for every 140 meters traveled. Write a function that takes the distance traveled (in kilometers) as its only parameter and returns the total fare as its only result. Write a main program that demonstrates the function.

    Refer sample input and output for formatting specification.

    All float values are displayed correct to 2 decimal places.

    All text in bold corresponds to input and the rest corresponds to output
  • CODING ARENA
  • x=int(input())
    m=x*1000
    f=m/140
    d=(200+(4/100)*(200)*f)
    print(round(d,2))
  • Test Case 1

    Input (stdin)
    25
    
    
    Expected Output
    1628.57
  • Test Case 2

    Input (stdin)
    225
    
    
    Expected Output
    13057.14

1 comment:

  1. Book your cab with travelertaxi, we are leading taxi services provider near you. We offer local and outstation taxi booking, car rental services at reasonable fare rates.

    ReplyDelete