The opportunity cost that Ann is going to have if she buys the pair of jeans is the chance to buy the pair of shoes with her allowance. She exchanged her opportunity of buying the shoes by buying the pair of jeans. This is the opportunity cost because the potential of losing the alternative (shoes) happened by purchasing the other.
(Mark me if u want)