For this case we have the following expression:

Where,
r: number of roses
p: number of petunias
We want to find the cost of 7 roses and 8 petunias
Therefore, we must replace the following values:

Substituting the values in the given equation we have:
Answer:
the cost of 7 roses and 8 petunias is $ 41