Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Method printTriangle that has a char parameter ch and an int parameter n.

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Method printTriangle that has a char parameter ch and an int parameter n.

    Write a method print Triangle that has a char parameter ch and an int parameter n.The method should print a triangular pattern with the perimeter consisting of the character ch and the interior (if there is one) consisting of blanks.As an example the call
    printTriangle('*',5);
    should produce output of the form

    *
    **
    * *
    * *
    *****


  2. #2
    Member snowguy13's Avatar
    Join Date
    Nov 2011
    Location
    In Hyrule enjoying a chat with Demise and Ganondorf
    Posts
    339
    My Mood
    Happy
    Thanks
    31
    Thanked 48 Times in 42 Posts

    Default Re: Method printTriangle that has a char parameter ch and an int parameter n.

    What do you have so far?
    Use highlight tags to help others help you!

    [highlight=Java]Your prettily formatted code goes here[/highlight]

    Using these tags makes your code formatted, and helps everyone answer your questions more easily!




    Wanna hear something funny?

    Me too.

  3. #3
    Junior Member
    Join Date
    May 2012
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Method printTriangle that has a char parameter ch and an int parameter n.

    i just started it rightt now so i dont have any solutions.

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Method printTriangle that has a char parameter ch and an int parameter n.

    This is not a place where you can dump homework and expect someone to do it for you. If you are honestly wishing to make the use of these forums and learn something, then make a hard effort to put something together, and if you have a problem ask a specific question regarding your code. Here's a start: ask yourself questions about the problem. How would I draw each line? How do I draw each character in each line? How do I put the answers to these two questions together? Write it out on paper if you have to.

Similar Threads

  1. Replies: 1
    Last Post: April 14th, 2012, 01:45 PM
  2. array as parameter
    By pjo in forum Java Theory & Questions
    Replies: 3
    Last Post: March 16th, 2012, 07:27 PM
  3. Shouldn't "list" be a parameter of the method Create()?
    By wholegrain in forum Object Oriented Programming
    Replies: 6
    Last Post: February 13th, 2012, 12:40 AM
  4. how can i pass objects into a parameter and display them in the method
    By em1980 in forum What's Wrong With My Code?
    Replies: 14
    Last Post: December 5th, 2011, 01:02 PM
  5. [SOLVED] Send and Receive Parameter
    By java_mein in forum JavaServer Pages: JSP & JSTL
    Replies: 2
    Last Post: May 14th, 2010, 02:22 PM

Tags for this Thread