Having difficulties with simple syntax errors, perhaps someone can assist me
Hey guys, I'm making this Counter Strike guide for my grade 12 computer science class final assignment and I can't seem to figure out what is wrong with the code! I'd really appreciate any help or feedback you guys can give, even if you can't fix the code it's fine!
Posted Jun 15, 2014, 4:36 PM UTC
Going over it really quickly, there's a few very obvious errors.
charName is of type String. String comparisons should be done with the .equals() method. Aside from that, you're assigning charName a value in your if-statement, which is not what you're looking for. I think you're looking for this:
2.
While your switch and cases are fine, you need to use the break; statement after each of your cases (except 4). Because now, if case 1 is picked, your program will execute choosePhoenix(), and then, when it's done, execute chooseElite, chooseArtic and chooseWelfare as well. So change this into:
This goes for the Counter-Terrorist section as well.
On line 278, you forget to close a String.
should be
At several points, you seem to be using a very odd " character. Namely this one: ”. As far as I know, this is not valid and should be replaced with ".