To find the value of X, we can follow these steps:

- Calculate the weight of tomatoes that got perished.
- Calculate the weight of tomatoes that were left to sell.
- Calculate the cost price of the remaining tomatoes.
- Calculate the selling price of the remaining tomatoes using the profit made.
- Calculate the per kg selling price of the remaining tomatoes.
- Calculate the per kg cost price of the tomatoes (X).

Let’s go through these steps:

- Calculate the weight of tomatoes that got perished:

Weight_Perished = Total_Weight_Tomatoes * Perished_Percentage Weight_Perished = 140 kg * (15/100) Weight_Perished = 21 kg

- Calculate the weight of tomatoes that were left to sell:

Weight_Left = Total_Weight_Tomatoes – Weight_Perished Weight_Left = 140 kg – 21 kg Weight_Left = 119 kg

- Calculate the cost price of the remaining tomatoes:

Cost_Price_Remaining_Tomatoes = Weight_Left * X Cost_Price_Remaining_Tomatoes = 119 kg * X

- Calculate the selling price of the remaining tomatoes using the profit made:

Selling_Price_Remaining_Tomatoes = Cost_Price_Remaining_Tomatoes + Profit Selling_Price_Remaining_Tomatoes = 119 kg * X + 560

- Calculate the per kg selling price of the remaining tomatoes:

Per_Kg_Selling_Price = (119 kg * X + 560) / 119 kg

- Calculate the per kg cost price of the tomatoes (X):

Since the vendor sold the remaining tomatoes at a per kg rate of 25% more than X:

Per_Kg_Selling_Price = X + 0.25 * X Per_Kg_Selling_Price = 1.25 * X

Now, we can equate the expressions for the per kg selling price and solve for X:

1.25 * X = (119 kg * X + 560) / 119 kg

Multiplying both sides by 119 kg to eliminate the denominator:

1.25 * X * 119 kg = 119 kg * X + 560

Simplifying further:

148.75 * X = 119 * X + 560

Subtracting 119 * X from both sides:

29.75 * X = 560

Dividing both sides by 29.75:

X = 560 / 29.75 X ≈ 18.82

So, the value of X is approximately **18.82**