Results 1 to 8 of 8
  1. #1
    Anseki's Avatar
    Anseki is offline Member
    Join Date
    Oct 2008
    Location
    Philippines
    Posts
    4
    Rep Power
    0

    Question comparing array using character

    hey guys! I need help...

    how can I compare two sets of character type array....:confused:

    I really need it...

    please help!!!!!!!!

    well the problem given to me is to that the user should give two names, one for boy and the othe for a girl...then I have to compare each letters...if any letter is the same then it should be added...that the problem given to me...

    the output will be:

    name of the guy:
    name of girl:
    number of same letters:
    Last edited by Anseki; 10-02-2008 at 11:26 AM. Reason: to be more specific

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  3. #3
    Anseki's Avatar
    Anseki is offline Member
    Join Date
    Oct 2008
    Location
    Philippines
    Posts
    4
    Rep Power
    0

    Default

    comparing the letters of each names given

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    When someone asks "what have you done up to now", that's usually a sign that you should post your code. You should also include in this code a region where you try to solve the problem at hand and indicate this location with a comment in your code.

    Also, if you do post your code, please use code tags so that your code will be well-formatted and readable. To do this, either highlight your code block and press the "code" button at the top above the message block or place the tag [code] at the top of your block of code and the tag [/code] at the bottom, like so:

    Java Code:
    [code]
       // your code block goes here
       // notice that the top and bottom tags are different here
    [/code]
    Good luck.

  5. #5
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    7

    Default

    you should also explain the exact behavior.

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

  7. #7
    kellaw is offline Member
    Join Date
    Oct 2008
    Posts
    24
    Rep Power
    0

    Default

    i will give you the pseudocode

    loop starts
    if (array1[i] == array 2[i])
    do something
    loop ends

  8. #8
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    First of all you have to get two names from the user and store them in char arrays. Then referencing to one array loop through the next array. In each completed cycle of the second array, increase the reference by one in the first array.

Similar Threads

  1. Comparing Strings
    By souFrag in forum Advanced Java
    Replies: 5
    Last Post: 05-21-2008, 10:03 AM
  2. please i need the code of comparing these two array lists.
    By raj reddy in forum JavaServer Pages (JSP) and JSTL
    Replies: 5
    Last Post: 04-18-2008, 08:42 AM
  3. comparing
    By Feng in forum New To Java
    Replies: 2
    Last Post: 11-23-2007, 10:40 AM
  4. reading text character by character
    By bugger in forum New To Java
    Replies: 2
    Last Post: 11-09-2007, 09:54 PM
  5. Comparing JavaWebFrameworks
    By pegitha in forum Web Frameworks
    Replies: 1
    Last Post: 05-18-2007, 07:23 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
  •