예제 #1
0
        public override bool Equals(object obj)
        {
            if (obj.GetType() != this.GetType())
            {
                return(false);
            }
            DigitList digitList = (DigitList)obj;

            return(this.listOfDigits.IsEqual(digitList.listOfDigits) && this.numberBase == digitList.numberBase);
        }
예제 #2
0
        public override void ExerciseRun()
        {
            Console.WriteLine("***This programm will decompose any integer number, that" +
                              " you enter,  to list of digits in base 10. And then it will be converted between two" +
                              " another bases that you will chose***");

            int       number = ServiceClass.InputAnyIntegerNumber("Enter any integer number to decompose it to digits in base 10");
            DigitList list   = new DigitList(number);

            Console.Write("\nSET first number base to convert number >>>");
            byte base1 = (byte)ServiceClass.InputNumberBaseNumber();

            list.ChangeBase(base1);
            list.ShowListOfDigits();

            Console.Write("\nSET first number base to convert number >>>");
            byte base2 = (byte)ServiceClass.InputNumberBaseNumber();

            list.ChangeBase(base2);
            list.ShowListOfDigits();
        }