I need to write a program that takes a user inputed binary "1001101" and turns it into decimal form. I know how to switch from digit to digit using modulus and /. I just dont know how to take the digits and assign a value from there. Any suggestions on what i can do?

This is my 2nd program so anything advanced i probably wont know.