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 7 of 7

Thread: star design programs

  1. #1
    Junior Member
    Join Date
    May 2010
    Posts
    6
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Post star design programs

    I need to get this output
    *
    * * *
    * * * * *
    please can some one help me by giving the codings..


  2. #2
    Junior Member
    Join Date
    May 2010
    Location
    Kurunegala, SriLanka
    Posts
    5
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: star design programs

    class Star{

    }

  3. #3
    Member
    Join Date
    Apr 2010
    Location
    The Hague, Netherlands
    Posts
    91
    Thanks
    3
    Thanked 10 Times in 10 Posts

    Default Re: star design programs

    class Space {
     private ArrayList<int, Star> stars = new ArrayList<int, Star>();
    }

  4. #4
    Junior Member
    Join Date
    Sep 2009
    Posts
    9
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: star design programs

    class Star {
    public static void main (String [] args){
    int a = Integer.parseInt(javax.swing.JOptionPane.showInput Dialog(null,"Insert Rows of Star:"));

    for (int i=0;i<=a*2;i++){
    if (i % 2 == 0){
    continue;
    }else{
    for (int j=0;j<i;j++){
    System.out.print ("*");
    }
    }
    System.out.println ("");
    }
    }
    }

    Try this code, may be it can solved your problem.

  5. The Following User Says Thank You to bocahTuaNakalzz For This Useful Post:

    madushankakurera (July 9th, 2010)

  6. #5
    Junior Member
    Join Date
    May 2010
    Location
    Kurunegala, SriLanka
    Posts
    5
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default star design programs with only- for loops

    class Star{


    public static void main (String args[]){


    for(int i=0;i<5;++i){
    for(int j=5;j>i;--j){
    System.out.print(" ");

    }
    for(int j=1;j<=i;++j){
    System.out.print("*");

    }
    for(int j=2;j<=i;++j){
    System.out.print("*");

    }
    System.out.println();

    }


    }



    }

  7. #6
    Junior Member
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: star design programs

    i need to print in this form
    1 2 3 4 5 6
    3 5 7 9 11
    8 12 16 20

    i need program for this

  8. #7
    Forum Squatter newbie's Avatar
    Join Date
    Nov 2010
    Location
    North Wales
    Posts
    661
    My Mood
    Stressed
    Thanks
    28
    Thanked 115 Times in 106 Posts
    Blog Entries
    1

    Default Re: star design programs

    Alas, after centuries of searching, I've finally found it...Sir spoon-feeder's treasure trove!
    Please use [highlight=Java]//code goes here...[/highlight] tags when posting your code

Similar Threads

  1. Want to write good programs
    By dak2007 in forum Member Introductions
    Replies: 2
    Last Post: April 22nd, 2010, 04:21 PM
  2. Replies: 2
    Last Post: April 12th, 2010, 11:13 AM
  3. How do you design a complex program
    By mydarkpassenger in forum Java Theory & Questions
    Replies: 5
    Last Post: March 19th, 2010, 06:52 PM
  4. Design question about maps
    By KaleeyJ in forum Java Theory & Questions
    Replies: 1
    Last Post: February 2nd, 2010, 03:17 AM
  5. What programs shall i make?
    By DarrenReeder in forum Java Theory & Questions
    Replies: 1
    Last Post: December 27th, 2009, 07:31 AM