Calculate the cost of driving to station b from station a with the distance from a to b and the price at station b using the function cost()

Calculate the cost of driving to station b from station a with the distance from a to b and the price at station b using the function cost()