aspose file tools*
The moose likes Beginning Java and the fly likes question from beginner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "question from beginner" Watch "question from beginner" New topic
Author

question from beginner

Russel Fieldhouse
Greenhorn

Joined: May 14, 2006
Posts: 4
Q: Write a method to display filled right-hand triangles using characters. The height of the
triangle and the character used to display a triangle should be passed as method
parameters. Note that your code can only output one character at a time.

filledTriangle(4,�*�)
$$$*
$$**
$***
****


i know how to write a method to display
*
**
***
****

but cant do Qu , anyone help me???
[ May 14, 2006: Message edited by: Russel Fieldhouse ]
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
Do you notice the pattern as you go to the next line?
Russel Fieldhouse
Greenhorn

Joined: May 14, 2006
Posts: 4
Originally posted by Keith Lynn:
Do you notice the pattern as you go to the next line?


yes, the pattern...i cant put the triangle "x" and "$" together
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
Why?
Russel Fieldhouse
Greenhorn

Joined: May 14, 2006
Posts: 4
Originally posted by Keith Lynn:
Why?



i just dont know how.

would you like to write such a example for me please? thx
Russel Fieldhouse
Greenhorn

Joined: May 14, 2006
Posts: 4
here is what i wrote:

Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Here's a thought to consider: as you clearly know, a "for" loop can have another "for' loop inside of it. What might not have occurred to you is that a for loop can have two or more for loops inside it, one after the other, that will execute in sequence. So, for example,



[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question from beginner
 
Similar Threads
class extension problem
complicated assignment
I need help - basic stuff (I think)
Exception problem.
recursion - sierpinskys triangle - HELP!!