Skip to content

This is a fare-bill calculator designed to compute the charges based on the kilometers traveled

Notifications You must be signed in to change notification settings

Sudhanshu-Ambastha/Fare-bill-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Fare Calculator

Description

This Python program calculates the fare for a given distance based on the following criteria:

  • For the first 10 kilometers, the fare is Rs. 11 per kilometer.
  • For the next 9 kilometers (from 11 to 19 km), the fare is Rs. 10 per kilometer.
  • For distances beyond 19 kilometers, the fare is Rs. 9 per kilometer.

Usage

  1. Run the fare_calculator.py script using Python.

  2. Enter the distance you've covered in kilometers when prompted.

  3. The program will calculate and display the total fare based on the criteria.

  4. If the entered distance is invalid, it will display "Invalid distance."

Example

Enter the distance (in kilometers): 15 The total fare for 15 km is Rs. 140

Try it Online

You can test the program online using Trinket by following this link.https://trinket.io/

Troubleshooting

If you encounter any issues or have questions, please don't hesitate to reach out for support.

Author

About

This is a fare-bill calculator designed to compute the charges based on the kilometers traveled

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages