Question: Write a program in JAVA to calculate the train fare according to the below fare table. First 50 kms:3$/km 51-100 kms:2$/km >100 kms:1$/km Sample Run:

Write a program in JAVA to calculate the train fare according to the below fare table. First 50 kms:3$/km 51-100 kms:2$/km >100 kms:1$/km Sample Run: Distance:80 Output:210$ (50*3+30*2) Distance:160 Output:310$ (50*3+50*2+60*1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!