Computer Science, asked by rkdutta2200, 5 months ago

a transport company charges fare for renting cars as per the given rate first 10 10/km per hr,next 20 8 km per hr, next 20 5 km per hour more than 50 3 km per hr write a program to input the taxi number and kilometres traveled.calculate the bill display the taxi number, bill amount and kilometres travelled.(JaVa)​

Answers

Answered by subhodeep96
0

Explanation:

ANSWER

x 0 1 2

y 3 8 13

Taxi fare for first kilometer = Rs. 8

Taxi fare for subsequent distance = Rs. 5

Total distance covered =x

Total fare =y

Since the fare for first kilometer = Rs.8

According to problem,

Fare for (x–1) kilometer = 5(x−1)

So, the total fare y=5(x−1)+8

⇒y=5(x−1)+8

⇒y=5x–5+8

⇒y=5x+3

Hence, y=5x+3 is the required linear equation.

Now the equation is

y=5x+3 ...(1)

Now, putting the value x=0 in (1)

y=5×0+3

y=0+3=3 So the solution is (0,3)

Putting the value x=1 in (1)

y=5×1+3

y=5+3=8. So the solution is (1,8)

Putting the value x=2 in (1)

y=5×2+3

y=10+3=13. So the solution is (2,13)

Similar questions