First, we need to find out how many cups of walnuts Melanie had.
Melanie had 25% more walnuts than John, so we can find out how many cups of walnuts Melanie had by adding 25% of John's walnuts to John's walnuts.
25% of John's walnuts is:
(25/100) x 4.5 cups = 1.125 cups
So, Melanie had:
4.5 cups + 1.125 cups = 5.625 cups
Melanie used 1.25 cups of her walnuts in a recipe for cookies, so she has:
5.625 cups - 1.25 cups = 4.375 cups of walnuts left.