Example #1
0
        public string ToHex()
        {
            var octaToDecimal = ToDecimal();
            var convert       = new DecimalSystem(octaToDecimal);

            return(convert.ToHex());
        }
Example #2
0
        public string ToOcta()
        {
            var binaryToDecimal = ToDecimal();
            var convert         = new DecimalSystem(binaryToDecimal);

            return(convert.ToOcta());
        }
Example #3
0
        private static void Main(string[] args)
        {
            DecimalSystem newDec    = new DecimalSystem("8271");
            BinarySystem  newBinary = new BinarySystem("10101010");
            OctaSystem    newOcta   = new OctaSystem("0123");
            string        ans;
            bool          flag = true;

            while (flag)
            {
                Console.Write("Please enter a number in any base: ");
                ans = Console.ReadLine();
                Show(ans);
                do
                {
                    Console.Write("Do you want to continue(y/n): ");
                    ans = Console.ReadLine();
                } while (ans != "y" && ans != "n");

                if (askUserForContinue(ans))
                {
                    Console.Clear();
                    continue;
                }
                else
                {
                    flag = false;
                }
            }
            Console.WriteLine((int)'A');
        }
Example #4
0
        public string ToDecimal()
        {
            var convert = new DecimalSystem();

            return(convert.AnySystemToDecimal(this.octa, 8));
        }
Example #5
0
        public string ToDecimal()
        {
            var convert = new DecimalSystem();

            return(convert.AnySystemToDecimal(this.binary, 2));
        }