dimanche 22 février 2015

Iteration, Recursion, and Multiplication



I am trying to understand what my instructor wants me to do. In his description " Design, implement and test a Java program Multiplication.java which includes an iterative method multIterative and a recursive method multRecursive. Both methods take the same parameters, the two positive integer numbers that will be multiplied and return the multiplication result. For both methods, use the technique of repetitive additions for achieving the multiplication of the two numbers. As an example, 4 multiplied by 6 should be calculated as 6 + 6 + 6 + 6 (i.e. four times six)."


I can understand the multiplication for recursion but not the iterative. Does he want me to make factorials? or what? I need help understanding. Examples would help!




Aucun commentaire:

Enregistrer un commentaire