Explanation
Correct answer: 41.
The number of cupcakes Vivian bought can be found by first finding the amount Vivian spent on cupcakes. The amount Vivian spent on cupcakes can be found by subtracting the amount Vivian spent on party hats from the total amount Vivian spent. The amount Vivian spent on party hats can be found by multiplying the cost per package of party hats by the number of packages of party hats, which yields $, or $. Subtracting the amount Vivian spent on party hats, $, from the total amount Vivian spent, $, yields $71 - \ 30, or \$$41. Since the amount Vivian spent on cupcakes was $ and each cupcake cost $, it follows that Vivian bought cupcakes.
Desmos solution:
Enter in Desmos:
Reviewed and rewritten by CookSAT