An interesting C# question

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

shieldguy

Thread Starter
Joined
Jul 14, 2006
Messages
5
Hi I am learning ASP.Net C# programming, My friend give me a very interesting question to solve

I have the following class decleration for a person, I need to write a C# code, for the following functions: PrintDescendants() and TestPrintDescendants()

PrintDescendants should return a string in the following format:

“childA ( grandChildAA ( greatGrandChildAAA () ) grandChildAB () ) childB ( grandChildBA () ) childC ()”


public class Person
{
List<Person> children;
string name;

public Person(string name)
{
this.name = name;
}

public string PrintName()
{
return name;
}

// print all of your descendants (children, grandchildren, etc)
// into a string
public string PrintDescendants()
{

}
}

[TestFixture]
class TestPerson
{
[Test]
public void TestPrintDescendants()
{
}
}



I will be very thankfull If any one can give me a hint what is actually I needed to do and how to solve the problem.

Thankyou
 
Joined
Sep 10, 2006
Messages
96
"childA ( grandChildAA ( greatGrandChildAAA () ) grandChildAB () ) childB ( grandChildBA () ) childC ()&#8221; <------ can You Pls Explain this?
 
Joined
Nov 16, 2006
Messages
9
Please give graphical representation if possible so that we understand your question
better.
please tell about the "child c,child b's " Parent
AS EJAZ asked
Tell what that function do?
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top