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
Get step-by-step solutions from verified subject matter experts
