It looks like you're new here. If you want to get involved, click one of these buttons!
you only ever declare price in the if statements so they are not accessible to the whole function. Write int price = 0; outside of the if statements and in the if statements set price = x;
Answers
you only ever declare price in the if statements so they are not accessible to the whole function. Write int price = 0; outside of the if statements and in the if statements set price = x;