I am writing a program that takes the service code (either 'R' for regular or 'P' for premium)and calculates a cell phone bill. I am having a problem getting the program to work right. When you enter a 'P' or 'p' it still calculates as if you had entered 'r'. If any of you can see what I have done wrong, I'd sure appreciate it. Thanks.
1. You need to use == for comparisons, not = which is assignment.
2. "or" does not work like that (I'm not to sure it works at all, although I may be wrong). The proper way to use or is (Boolean statement) or (Boolean statement). So, to do yours, it would be (servCode == 'p' || servCode == 'P'), with ||, the "or" operator.