02-17-2012, 01:34 AM
I can't explain things very well though
I can give you some non-C code though!
Part 3:
Part 4:
Part 5 (lazily done b/c i'm tired:
I can give you some non-C code though!
Part 3:
Code:
public void reverseName(name)
{
string newName = "";
for (int i = name.length; i > 0; i--)
{
newName += name[i];
}
return newName;
}
Part 4:
Code:
public void detectSpace(name)
{
for (int i = 0; i > name.length; i++)
{
if (name[i] = " ")
{
return i;
}
}
return null;
}
Part 5 (lazily done b/c i'm tired:
Code:
public void lastNameFirst(name)
{
string firstName = "";
string lastName = "";
int space = detectSpace(name); //This is the previous part!
for (int i = 0; i > space; i++)
{
firstName += name[i];
}
for (int i = space ; i > name.length; i++)
{
lastName += name[i];
}
return lastName + " " + firstName;
}