Hi All,
I'm trying to teach myself Java and came across a problem I'm hoping to get insight on. I need to basically figure out what the possible output is for candidate blocks of code, which would be substituted in the program where the underline is. Here it is:
Candidates:
x = x + 3;
x = x + 6;
x = x + 2;
x ++;
x --;
x = x + 0;
Possible output:
45 6
36 6
54 6
60 10
18 6
6 14
12 14
I've tried iterating through this code, but my results will either match only with some of the x values of the possible output, or not at all...I'm not sure what I'm doing wrong.
I would appreciate any assistance. Thanks!