Results 1 to 7 of 7
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: java progaram

  1. #1
    anithababu100 is offline Member
    Join Date
    Dec 2011
    Posts
    2
    Rep Power
    0

    Default java progaram

    Dear Friends,
    I am new to java and i faced one program.Can any one just help me getting output for this program given below:

    a
    a b
    a b c
    a b c d
    a b c d e
    a b c d e f
    a b c d e
    a b c d
    a b c
    a b
    a

    how can we get this out using for loop.please help me.Thank you!!!

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,457
    Blog Entries
    7
    Rep Power
    20

    Default Re: java progaram

    I think it's the easiest to split your 'problem' in two parts: the top part and the bottom part; number the lines from 0 to 5 (top to bottom) and the positions (from left to right) 0 to 5; for a line i and a position j, try to figure out the character at that position. If you have solved all that, it is easy to solve the entire bottom part of your problem.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Rewry is offline Member
    Join Date
    Dec 2011
    Posts
    19
    Rep Power
    0

    Default Re: java progaram

    Here is the code to perform the function u described. I did it in a hurry so id double check it, plus Im leaving it up to you to discover what I did, so that you understand better. Ill just give you a hint, its possible to look at char to their ASCII (or unicode) number values
    Last edited by Rewry; 12-02-2011 at 04:50 PM.

  4. #4
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default Re: java progaram

    @Rewry, this is what we call spoon feeding. We don't do that here. JosAH described how he can accomplish this, but provided no code. This is how we prefer our questions to be answered. If your code works, and he uses it (Copy pasta), then he learns nothing. What did that accomplish? You just hurt someone learning the basics by not forcing them to think and understand how this stuff works. Until you are forced to figure it out by yourself, maybe with guidance but not spoon fed, you will not learn anything to its full extent.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  5. #5
    Rewry is offline Member
    Join Date
    Dec 2011
    Posts
    19
    Rep Power
    0

    Default Re: java progaram

    Sorry first day using this forum. I didnt know was just trying to help...wont happen again

  6. #6
    anithababu100 is offline Member
    Join Date
    Dec 2011
    Posts
    2
    Rep Power
    0

    Default Re: java progaram

    I couldn't see any code here and i have tried this code many times but didn't get the output,i am new to java.I understand everyone saying for my welfare,not to spoon feed.can you please send me this code to my id [email removed]@gmail.com, it will be so useful to get an idea and develop further and others too thanks for the reply!!!!
    Last edited by DarrylBurke; 12-06-2011 at 06:44 PM. Reason: Removed email

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,202
    Rep Power
    19

    Default Re: java progaram

    Moderator advice: Don't post your email address on a public forum and don't blatantly ask to be spoonfed. Also, don't solicit off-forum communication, as that defeats the very purpose of a forum, which is to share problems and their potential solutions.

    db
    Fubarable likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 3
    Last Post: 03-08-2009, 02:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •