I am having a hard time testing the comparison methods of my program. Everything else tests ok. I am not sure if I need to keep the comparison methods that I have and rewrite the testing code, or rewrite the comparison methods and keep the testing code.
I'm afraid that you will have to be more specific as to what your problem is. I took the code that you posted and ran it, and it ran fine (after I substituted my own functions for the SavitchIn class, of course...)
I double checked all of the statements printed, and they all printed correctly. What problem are you receiving? An error, or is one of your calculations wrong?
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
My problem was this: My comparison methods are boolean. I wasn't sure what to do if both of the temperature scales were the same, but I think I'm on to something now.
Let me know if you need any more info, if I am doing the right thing, or if I am off in left field somewhere. Sorry about the Savitch code. That is the author of my textbook. It is a file that was created to run these methods.
Not a problem about the Savitch code...enough people here use it, I really should find a copy of it so that I can help without substituting my own code.
Why should it matter if both scales are the same or not? The greaterThan method handles that by calling getC or getF appropriately. It just concerns itself with the scale of the current object and makes sure it reads the value of the other object in that scale, so the other object's actual scale doesn't matter.
In other words, I don't see any problems.
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Why should it matter if both scales are the same or not? The greaterThan method handles that by calling getC or getF appropriately. It just concerns itself with the scale of the current object and makes sure it reads the value of the other object in that scale, so the other object's actual scale doesn't matter.
Do you mean that you don't see any problems since I rewrote it? The main problem I had was this: I was using a boolean as a comparison method. The boolean can only return two values. I know you already know this.
This is what I was having problems with. I hope I am on the right track with the new code I just wrote (and posted).