Cheating Network
 
 

Go Back   Cheating Network > Programming > General
Reload this Page Some Java Help



General

This is a discussion about Some Java Help within the General section, where you will General Talk of Programming



Reply
 
LinkBack Thread Tools Display Modes
Old 10-19-2009, 03:28 PM   #1 (permalink)
Senior Member
 
Join Date: Oct 2008
Posts: 115
Reputation: 6
redwings0921 is an unknown quantity at this point

cBay Rating:
Default Some Java Help

Hey, I am doing basic java and we are doing some pyramids and I am really struggling. I really want to learn java, so if anyone would be nice enough to help me out please let me know. I would think it would be easier to do it over aim rather then do it over the thread, but basically i have to make 4 pyramids
*
**
***
****
*****

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

-----------------*
---------------*-- *
-------------* --* --*
-----------* --* --* --*
---------*-- *-- *-- *-- *
edit: **** the above one took out the spaces so im gunna replace the spaces wit -

and the above one flipped. I got the first 2, but i can't get the second 2. Also, they have to rely on the input, so for the above pyramids the input was 5. The input is between 1-20. Any help is greatly appreciated

edit: will be posting code i have atm shortly


Code:
package loops;
import java.io.*;
public class Main {  
    public static void main(String[] args) {   
int userinput = 0;
do
{
    System.out.println("enter number less than 18");
    userinput = Cherokee.readInt();
}while(userinput>= 18 && userinput<1);

for(int x = 0;x<=userinput;)
{
    for (int y = 0;y<x;y++)
        System.out.print("*");
           System.out.println("");
           x++;
          }
System.out.println(" ");
for(int x = 0;x<userinput;)
{

    for (int y = 0;y<userinput;)
    {

       if(x>y)
           System.out.print(" ");
       else
           System.out.print("*");
     y++;
    }
System.out.println("");
x++;
}
System.out.println(" ");       
    } 
}
the cherokee. is from a class file my teacher made
__________________
PM me for free cam credits
redwings0921 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Tags
java


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Todd0012 Computers 5 10-03-2009 07:08 AM
Does anyone do Java? Ryutso General 11 08-16-2009 01:39 PM
Need Help with Java Bot kelvinator44 Bot Makers 0 06-09-2009 10:58 AM
Java or c++? zero Chit Chat 10 10-26-2008 07:02 PM




Powered by vBulletin
Copyright © 2000-2008 Jelsoft Enterprises Limited.
Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.