Results 1 to 5 of 5
  1. #1
    ashin is offline Member
    Join Date
    Nov 2008
    Posts
    71
    Rep Power
    0

    Default how do i count the letter that the user had chosen?

    hi, how do i count the letter that the user had chosen?

    example: We have "kavin","kier","kyle" names then when the program asks the user "what letter do you want to count?"
    If the user enters letter 'e'. The output should be we have 2 e's.
    tnx... asap pls..
    :cool:

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    What have you tried? How would you do it "manually"?
    Suppose someone takes you into the American president's wardrobe and asks you how many pink shirts there are in it. How would you do it?

  3. #3
    ashin is offline Member
    Join Date
    Nov 2008
    Posts
    71
    Rep Power
    0

    Default

    yes! exactly :)
    :cool:

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Well, since I can hardly kidnap him to question him about it (he'd probably not know himself anyway), I'd start by assuming that there are no pink shirts at all. Why would anyone buy a pink shirt, right?
    Then I would start at the first shirt, check to see if it's pink. If it indeed is pink, I'd add one to my supposed number of pink shirts. Otherwise I just go on to the next one and repeat the process.

  5. #5
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    7

    Default

    I don't think the president would wear pink. He seems like more of a salmon colored polo guy to me.
    Liberty has never come from the government.
    Liberty has always come from the subjects of government.
    The history of liberty is the history of resistance.
    The history of liberty is a history of the limitation of governmental power, not the increase of it.

Similar Threads

  1. Replies: 8
    Last Post: 09-15-2009, 12:53 PM
  2. Letter view
    By wide in forum NetBeans
    Replies: 1
    Last Post: 07-02-2009, 03:40 PM
  3. how do i initials the word so i get the first letter only
    By mikeitalydz in forum New To Java
    Replies: 15
    Last Post: 04-19-2009, 11:35 AM
  4. Printing Out Every Other Letter
    By Agent in forum New To Java
    Replies: 4
    Last Post: 11-20-2008, 01:43 AM
  5. Letter with Letters
    By elgatoboricua in forum New To Java
    Replies: 7
    Last Post: 09-16-2008, 03:59 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
  •