Create a program that will display the following patterns on the console. Create a function for each operation.
See the file towerdata.dat for the only allowable character in the ASCII tower. You are allowed to make the
center portion as wide as you like, but the minimum size is shown in the towerdata.dat file.
Functions
seattleTower(int size) Generates the ASCII tower for size range 1 – 15 inclusive
numberPattern(int lines) Generates the number pattern shown.
diamonPattern(int diamonds, int height) Generates a series of diamonds side by side for some height.
diamonds range 1 – 15, height 3 – 50, inclusive.
decimalToBinary(int value) Converts a decimal value to binary:
decimalToBinary(23) = 10111
try the decimal to binary.
there are a couple of ways to do it..
you can loop over an integer, extracting a bit, adding the character to a string each time.
you can also convert the integer into hex-text string, and note that a nibble (one hex digit, being half a byte, which is 2 hex digits) can be converted to binary in a lookup table (16 values) for each hex digit, giving you 4 binary digits for each operation instead of one like the simple loop. Either of those ideas should give you some good practice.