Quote:
Do I have to add this line more and update the "term" value?
Yes. That is your problem.
1. Your calculate method will have single print only.
2. You need to define two calculate methods - lets say calculatesi & calculateci separate for simple and compund
You need to call calculate 5 times with different term values. Query is to calculate interest if term is different and rest all the same. So you need to change the term and call method.
obj.calculatesi(500000, 10, 0.035, ?);
obj.calculateci(500000, 10, 0.035, ?);
obj.calculateci(500000, 10, 0.035, ?);
obj.calculateci(500000, 10, 0.035, ?);
obj.calculateci(500000, 10, 0.035, ?);
One more thing, Simple Interest and Compound Interest for a year would turn out same and thus if you plan to use one method only, you can but change the print for that one case.
It's a clear assignment. Please go ahead and try it now. With above details, if you are still not clear then I would suggest to start reading and learning from some book or tutorial first and grasp the concepts.
You can start from here:
Java Tutorial - basics[
^]