Hi, there. I need a little help writing a program in
java that will find the difference between two dates, using only months and years. I have just about all of my code written out. Unfortunately, when entering certain months, the desired output is not given. I've looked over all my math and code and everything seems to be in order, so I can't figure out why some dates work and others do not. Towards the bottom of my program, you can see where I attempted to convert years to months in the case of a negative amount of months being reached. Am I doing that part correctly? In case anyone is wondering, I know it would be much easier to simply use the number value of each month. However, my teacher stressed that the whole month must be spelled out. This assignment is due on wed. and I'm completely lost. Below you will find my current code. Any help would be greatly appreciated : )
- Aaron