Hints for doing assignment #1.
1. getBin() is similar to Prog1, done on Sep 18 You can perform the required
operation by considering the digits going from left to right, as the program
does. Start by Dividing by 128. Each iteration of the loop you divide by one
less power of 2. However now as oppoed to Prog1, each digit you obtain must be
concatenated with a string to form the binary number.
2. checkBin() is similar to Prog8, done on Sep 13. 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.