Quote (Jibbosh @ Oct 2 2014 12:49am)
well... 3x4 it's 4+4+4
and 5x4 its 5+5+5+5
So I guess that .... it takes the biggest number of the 2, and it makes an addition ... 3 times ... , that's pretty much what I don't understand how to do. I get it, how to get the biggest number.
But now I have to tell him to do it "x" number of times which "x" is the smallest number..
Excellent, now we have a starting spot based on what you said
Code
private void printMultiplication(int a, int b){
int base = // pick the biggest of a and b
int repeatCount = // pick the smallest of a and b
String output = "";
// repeat this #repeatCount times:
{
// add base and some punctuation to output
}
// print out the output
}
now write some code to fill in the template.
eg: do you know anything in java that will repeat code a fixed number of times?
how do you determine which integer is bigger than the other?
This post was edited by carteblanche on Oct 1 2014 10:57pm