Computer Science, asked by yadavpalak0805, 6 months ago

Write a program to input distance travelled by a person and calculate taxi fare according to given slab: distance rate of fare Up to 5 Kms ₹ 25 6 to 10 Kms ₹ 5/Km 11 to 20 Kms ₹ 4/Km 21 Kms or above ₹ 10/5 Kms

Answers

Answered by Prantikghosh
0

Answer:

ANSWER

Let fixed charge be Rs x and charge per km be Rs y.

⇒x+10y=105...(1)

⇒x+15y=155..(2).

Now From eq 2

⇒15y=155−x

⇒y=  

15

155−x

​  

...(3)

Substituting y from eq3 in eq1

⇒x+  

15

10(155−x)

​  

=105

⇒15x+1550−10x=1575

⇒5x=1575−1550

⇒5x=25

⇒x=5

Substituting x in eq2

⇒5+15y=155

⇒15y=155−5

⇒15y=150

⇒y=10

Hence x=5    and  y=10

Fixed charge is Rs.55 and the charge per kilometer is Rs.1010  

For 2525 km person have to pay = 5+10×25=255Rs.

Similar questions