bt1942
asked on
write a method called printTriangle. How to start?
(Objects first with java, A practical Introduction using Blue J, Third Ed, David J. Barnes & Michael Kolling)
Hi
I have to write a method called printTriangle.
example: printTriangle(4);
output should look like this:
*
**
***
****
and I don't know how to start. Can you please give me an advice?
Hi
I have to write a method called printTriangle.
example: printTriangle(4);
output should look like this:
*
**
***
****
and I don't know how to start. Can you please give me an advice?
ASKER
chaituu// that seems very complicated, I just need to write a simple method soething like
public void printTriangle()
{
int n = 4;
String s = "*";
for(int row = 1; row<= n; row++)
{
System.out.println(s);
}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
yep, javaexperto, i missed that detail on the new line ; )
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
looks like i wasnt the only one working on it, i wasnt fast enough :)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your help!
https://www.experts-exchange.com/questions/22510737/Star-Counter.html