This is a tricky question because you might use the ratio and proportion method. However, there are 3 terms involved. To cut it down to 2, let's lump the profit rate. The solution is as follows:
10:5/2::8:x/3
Solving for x,
20/5 = 24/x
x = 24(5)/20 = 6
Hence, it will earn 6 dirhams of profit.