I've written a little program to compute the pay for some transcription work, but I've got a problem. The program needs to ignore where the format is "Standard" or "standard" (depending on what the user enters). I think I need to use some kind of logical OR operator, but I've used both | and || and gotten compiling errors. Here's the code. Please forgive me if it's not 'compact' enought; I'm still learning, and often added comments to clarify for myself what I'm trying to do. I haven't run it yet -- can't until it compiles correctly:
When I compile, this is the messages I get with either | or ||:
NCCTranscript.java:30: operator || cannot be applied to boolean,java.lang.String
if (transcriptFormat.equals("Standard") || ("standard")) {
Obviously I'm not using this correctly, but I can't figure out why. The program needs to ignore the case of the
word, that's all.
Also: what do I need to code to get the result to only two decimal places, since it's a dollars and cents format?
I figured out the first part -- at least for now -- I just added the another .equals method to the second condition
It compiled
, but didn't give the right result
so I'll have to figure that out as well. Just trying to get the math right.
[Edit]Line breaks to keep within width of screen. CR[/edit]