1. Older computers used Binary Coded Decimals (BCD) to represent integers. In this each digit is represented by using 4 bits. So 0 is 0000, 1 is 0001, 2 is 0010, ... 9 is 1001. The remaining 4 bit patterns, namely 1010 onwards are illegal. So 32 bits can store upto 8 digits. To represent a negative number the sign is also encoded using 4 bits. However, we are interested only in positive BCD numbers. For example assuming we have 32 bits the number 123 will be represented as (0000) 5 times followed by 000100100011.
Define a class BCD with a single constructor which takes an int argument and creates its BCD equivalent. Write methods for adding, subtracting, multiplying and dividing BCD numbers. Also, write methods to check for <, > and == between two BCD numbers.