JAVA class program help needed


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: JAVA class program help needed

  1. #1
    Join Date
    Mar 2003
    Posts
    4

    Lightbulb JAVA class program help needed

    my teacher really doesn't teach us java that much and gives us stuff to do when no one has any idea how to do it.

    ok i have a couple of questions. ok 3 really.

    ok the first one is this.
    Code:
    {public class exercise5b{
    	
    	public static void main(String args[])
    	{
    	 	
    		for(int row=10;row<=10;row--)
    		{
    			for (int ast=1;ast>=row;ast++)
    			  System.out.print('*');
    			System.out.println();
    		  
    		}
    			
    		
    		
    		
    	 
    	 	
    	}
    }
    Which produces
    Code:
    **********
    *********
    ********
    *******
    ******
    *****
    ****
    ***
    **
    *
    and the question is how to make it look like this
    Code:
    **********
     *********
      ********
       *******
        ******
         *****
          ****
           ***
            **
             *
    I can not figure this out if it saved my life. I have tried to change everything i can and i can not get it like that.

    Q#2.
    Anyone know how to make a for loop to figure out the Pythagorean triple of triangles all no lager that 500?

    and #3.
    basically kinda like the first one where i have to write a program to make 4 seperate triangles right next to each other. with for loops of course.
    example.
    Code:
    *           ********** **********           *
    **          *********   *********          **
    ***         ********     ********         ***
    ****        *******       *******        ****
    *****       ******         ******       *****
    ******      *****           *****      ******
    *******     ****             ****     ******* 
    ********    ***               ***    ********
    *********   **                 **   *********
    **********  *                   *  **********
    I appreciate any help at all. i really do. Thank you again.

  2. #2
    Join Date
    Mar 2003
    Posts
    84
    this problem was posted and answered in the general forum.
    I'm surprised more of you people don't get hit by cars.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center