Uploading here instead of fb - coding, abstraction, base numbers

Page 56, "Code" by Charles Petzold.
Is there a way to calculate the translation of base-8 to base-10; and, as an extension of this, from any base to another?

Page 56, "Code" by Charles Petzold.
Is there a way to calculate the translation of base-8 to base-10; and, as an extension of this, from any base to another?