Here is the complete code for my class and my test class. I've highlighted the problem areas and described the problem below.
Start of test class:
I'm working on a lab for school but blueJ is telling me that my surrenderValue is returning "NaN" (which I know is Not a Number). I believe the issue is with the objects I am trying to use in the calculation in my WholeLifePolicy class's surrenderVal method. Any help asap would be greatly appreciated.
More precisely, you get NaN if you divide 0 by 0, but it only works in floating-point arithmetic. In floating point, if you divide anything else by 0 you get (±)∞, and in integer arithmetic you get an Exception if you divide by 0.