am writing a class, within my class i need an instance method(without using library routine) that convert from other base to base 10
private int otherbase2Decimal(int Decimal, int otherbase)
{
//want my code to handle exception if base <2 or >10)
try
{
if ((otherbase < 2) || (otherbase > 10))
}
catch(FormatException)
{
Console.WriteLine("otherbase must be in range 2-10");
}
else
{ if (Decimal !=0)
{.........return sum;// need help/code on d algorithm that will return sum as decimal num.thanks
}
}
Loading
Sam HobbsPosted Mar 30, 2010, 6:01 PM
So 321 in base 4 is 1+(2*4)+(3*16), correct?
PrincePosted Mar 30, 2010, 2:37 PM
Sam HobbsPosted Mar 30, 2010, 12:13 PM