Issue with IF statement condition
I think this is your problem (from the full code snapshot)

(acc2 &gt;= 20 &amp;&amp; acc2 &gt;= 40))


I believe it should be (like your first snapshot)

(acc2 &gt;= 20 &amp;&amp; acc2 &lt;= 40))


Note that the first is greater than or equal to 40 rather than less than or equal to. Also note you've done this when determining whether or not acc2 is between 41 and 60 in the else if part of that same if statement.

I have no idea why the code differs between your first and third snapshot. Potentially you have spotted this already and failed to update the full code being run?