ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

C# Palindrom Recursive Program

(1/2) > >>

h0meopathic:
I have to make a program using C# that makes a PalindromeTester using Recursive methods. I can make the program using normal methods i.e. while statements and nested if statements. I can't figure it out even after doing a lot of research and while looking at sudocode from someone writing it in java. Could someone help. I don't necessarily want someone to do the work for me but help me think it through using the c# language. I would talk to my Teacher about it but she can't bring herself to coming to my level. People with Ph.D's shouldn't be allowed to teach low level college classes. 

Renox:
Homeo, I am glad that you took my advice and registered on the forums! You'll find that the people here are EXTREMELY helpful and ALWAYS provide knowledgeable solutions...

I am put together a couple things to take a look at... I haven't really had the time to put together some coding but I have found some that has already been put into use... If you or anyone else knows java well here is some coding that will make you smile: http://www.public.asu.edu/~navabi/chap05/PalindromeTester.java... If anyone could convert this from Java into C# that would be wonderful... I am not too go with Java yet..

Here is a link for Recursion that you might want to look at:http://en.wikipedia.org/wiki/Recursive_algorithm

I will try to look for some more things that might be beneficial to you... If anyone else can help, please do!

tinjaw:
h0meopathic ,

I am sure many of us here would be happy to help, but could you please help us help you?

I can make the program using normal methods i.e. while statements and nested if statements.-h0meopathic (April 17, 2007, 09:38 PM)
--- End quote ---

Attach the source code file to your posting so we can see what you have. Also attach the java pseudo code or provide a link to it.

h0meopathic:
This is the Palindrom in non recursive format but I need to put it in recursive format. From my understanding I should put most of this code in a method, probably in another class, then have the main method call upon it every time the system loops
==========================================================

--- Code: C# ---namespace RecursivePalindromeTester{    class Palindrome    {        String str, another = "y";            int left, right;             while (another.ToUpper() == "Y")            {                Console.Out.WriteLine("Enter a potential Palindrome:");                str = Console.In.ReadLine();                 left = 0;                right = str.Length - 1;                 while (str[left] == str[right] && left < right)                {                    left++;                    right--;                }                 Console.Out.WriteLine();                 if (left < right)                    Console.Out.WriteLine("String is Not a Palindrome.");                else                    Console.Out.WriteLine("String is a Palindrome.");                                Console.Out.WriteLine();                Console.Out.Write("Test another PalindromTester (Y/N)? ");                another = Console.In.ReadLine();           }}

tinjaw:
h0meopathic,

Edit your posting and use the "insert code" button and choose the proper highlighting language. That will make it look all nice and pretty, as well as make it easier for others to read.

For example:

--- Code: C++ ---String str, another = "y";int left, right; while (another.ToUpper() == "Y"){    Console.Out.WriteLine("Enter a potential Palindrome:");    str = Console.In.ReadLine();     left = 0;    right = str.Length - 1;     while (str

Navigation

[0] Message Index

[#] Next page

Go to full version