Esempio n. 1
0
        /// <summary>
        /// The Choice method let the console user choose from matric and imperial units.
        /// </summary>

        public void Choice()
        {
            int unitChoice = ConsolHelper.SelectChoice("\t Body Mass Index\n\t\t By Yamin Hassan" +
                                                       "\n\tPlease use matric units to calculate your BMI", choices);

            ChooseUnits(Convert.ToInt32(unitChoice));
        }
Esempio n. 2
0
        /// <summary>
        /// This method converts the input values to the output value
        /// </summary>
        public void PrintResults()
        {
            while (true)
            {
                FirstChoice  = dictionary.ElementAt(ConsolHelper.SelectChoice("\tPick 'From' the Unit in the List, you would like conversion", choices) - 1).Key;
                SecondChoice = dictionary.ElementAt(ConsolHelper.SelectChoice("\tPick 'To' the Unit in the List, you would like conversion", choices) - 1).Key;
                Amount       = ConsolHelper.GetInput("\tPlease select the amount\n");

                Console.WriteLine("The Result is:");
                Console.WriteLine(GetResult());
                Console.WriteLine("\tWould you like to another Conersion \n Yes \n No");
                String lastcommand = Console.ReadLine().ToLower();
                if (lastcommand == Yes)
                {
                    continue;
                }

                break;
            }
        }