Computer Choice: Part 2


I cannot detect an error in my code. What am I missing here?


Your && statement is slighly wrong. It needs to look like this.

computerChoice <= 0.66 && computerChoice > 0.33

However I do not see any point in the && > 0.33.


Thank you! Why do you say the latter half is unnecessary?


the second half is unnecessary because if cc < .33 you will get rock and the program will leave the if statements, if it is greater it will check to see if <= .66 if true cc will select paper and exit the if statements, else it will be greater and you will get scissors.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.