Hints for doing assignment #1.
1. getBin() is similar to Prog5, method addEm() done on Sep 11. You can
perform the required operation by considering the digits going from right to
left, as addEm() does or going from left to right. If you choose the latter,
instead of moding by 10, divide by 128. Thus each time you divide by one less
power of 2. Each digit you obtain must be converted to a char and this you must
use casting [use (char)]. However, the int you get will be the int with the
ascii code of 0 or 1, so you must do some conversion.
2. checkBin() is similar to Prog1, done on Sep 11. But now instead of
multiplying by 10, multiply by 2. When you add the character you get from the
string to the sum, you must convert the char to an int. Now, since you are
going from char to a wider type int, you do not cast. You must however convert
the char value (which is the ascii code) to 0 or 1.