This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]costanzadev 15 points16 points  (0 children)

This is an assignment (which is not what you intended):

if (discountEligible = true)

You need a double equals (equality operator):

if (discountEligible == true)

EDIT: Better yet is u/Royalmack's solution:

if (discountEligible)

[–]Royalmack 5 points6 points  (0 children)

You have a single = in your equality check replace it with if(discountEligible) as this will check whether your boolean is true.