Results 1 to 8 of 8
Thread: comparing array using character
- 10-02-2008, 09:37 AM #1
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 10:26 AM. Reason: to be more specific
- 10-02-2008, 12:23 PM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Ok, what you have done up to now? Where are you stuck with.
- 10-03-2008, 12:23 AM #3
comparing the letters of each names given
-
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:
Good luck.Java Code:[code] // your code block goes here // notice that the top and bottom tags are different here [/code]
- 10-03-2008, 03:37 AM #5
Senior Member
- Join Date
- Sep 2008
- Posts
- 564
- Rep Power
- 5
you should also explain the exact behavior.
- 10-03-2008, 04:20 AM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Seems waiting for a code, nothing is done.
- 10-03-2008, 12:53 PM #7
Member
- Join Date
- Oct 2008
- Posts
- 24
- Rep Power
- 0
i will give you the pseudocode
loop starts
if (array1[i] == array 2[i])
do something
loop ends
- 10-03-2008, 07:28 PM #8
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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
-
Comparing Strings
By souFrag in forum Advanced JavaReplies: 5Last Post: 05-21-2008, 09:03 AM -
please i need the code of comparing these two array lists.
By raj reddy in forum JavaServer Pages (JSP) and JSTLReplies: 5Last Post: 04-18-2008, 07:42 AM -
comparing
By Feng in forum New To JavaReplies: 2Last Post: 11-23-2007, 09:40 AM -
reading text character by character
By bugger in forum New To JavaReplies: 2Last Post: 11-09-2007, 08:54 PM -
Comparing JavaWebFrameworks
By pegitha in forum Web FrameworksReplies: 1Last Post: 05-18-2007, 06:23 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks