Homework Three
Printing Numbers in Binary using a Stack
Due: Thursday February 10

Write a C++ program that uses a stack to convert an integer into an 8 bit binary number. The following are some sample runs of such a program.

Enter an integer:
9
That number in binary is
0001001

Enter an integer:
256
Too large to print in 8 bits.

To save you a little time (I hope), Here is a c++ program that I wrote that prints an integer vertically. The process of converting an integer to binary is very similiar. Of course, you will need to rewrite some of main() and all of the class's functions.

Email your source code to dannellys2@winthrop.edu by the beginning of class on Thursday Feb 10. Submit your file using Pine. I will use the g++ compiler to test your code.