// Main method to use to add the student
        public void AddStudents()
        {
            bool finish = false;

            while (!finish)
            {
                Console.WriteLine("\t\t You can add Student details and Grade Here\n\t\t Please " +
                                  "follow the instructions");
                Console.WriteLine("\t\tPlease Enter Student Id");
                int id = Convert.ToInt32(ConsolHelper.GetInput());
                Console.WriteLine("\t\tPlease Enter Students's Full Name");
                string name = Console.ReadLine();
                Console.WriteLine("\t\t Please Enter The Final Mark of the Student");
                int     mark    = ConsolHelper.GetInput1();
                Student student = new Student(id, name, mark);
                AddObject(student);

                Console.WriteLine(student);

                Console.WriteLine("Please enter yes for main menu or press any key to exit");
                // continue or finish the program
                string lastcommand = Console.ReadLine().ToLower();
                if (lastcommand == "yes")
                {
                    finish = true;
                    MainMenu();
                }
                else
                {
                    break;
                }
            }
        }
Example #2
0
        /// <summary>
        /// The PrintMatricResults calculate the Matric units and display the result.
        /// </summary>

        private void PrintMatricResults()
        {
            bool finish = false;

            while (!finish)
            {
                Console.WriteLine("\t Body Mass Index\n\t By Yamin Hassan");
                Console.WriteLine("\n\tPlease use matric units to calculate your BMI" +
                                  "\n\t Please  Enter your height in Metres >");

                HeightMetres = ConsolHelper.GetInput();

                Console.WriteLine("\tPlease  Enter your height in Centimetres >");
                HeightCentemetre = ConsolHelper.GetInput();

                Console.WriteLine($"\tWell you are {HeightMetres} Metres and {HeightCentemetre} Centimetres  tall");


                Console.WriteLine("\tPlease enter your weigt in Kilograms >");
                WeightKg = ConsolHelper.GetInput();

                Console.WriteLine("\tPlease enter your weigt in Grams >");
                WeightGrams = ConsolHelper.GetInput();

                Console.WriteLine($"\tThanks for your weight. You weight: {WeightKg}KG and {WeightGrams}");

                double Result = Math.Round((WeightKg + (WeightGrams / 1000)) / Math.Pow((HeightMetres +
                                                                                         (HeightCentemetre / 100)), 2), 1);
                Console.WriteLine(Result);
                ConsolHelper.BmiResult(Result);


                String lastcommand = Console.ReadLine().ToLower();

                if (lastcommand == "yes")
                {
                    finish = true;
                    Choice();
                }
                else
                {
                    finish = false;
                    break;
                }
            }
        }
Example #3
0
        /// <summary>
        /// The PrintMatricResults calculate the Imperial units and display the result.
        /// </summary>
        public void PrintImperialConversion()
        {
            bool finish = false;

            while (!finish)
            {
                Console.WriteLine("\t Body Mass Index\n\t By Yamin Hassan");
                Console.WriteLine("\n\tPlease use matric units to calculate your BMI" +
                                  "\t Please  Enter your height in Feet >");

                HeightFeet = ConsolHelper.GetInput();
                Console.WriteLine("Please enter your height in Inches");

                HeightInches = ConsolHelper.GetInput();
                Console.WriteLine($"\tWell you are {HeightFeet} feet and {HeightInches} Centimetres  tall");

                Console.WriteLine("\n\tPlease enter your weigt in stones >");
                WeightStone = ConsolHelper.GetInput();

                Console.WriteLine("Please enter your weight in Pounds");
                WeightLbs = ConsolHelper.GetInput();

                Console.WriteLine($"\tThanks for your weight. You weight: {WeightStone} Stones and {WeightLbs} Lbs");

                double Result = Math.Round(((WeightLbs + WeightStone * 14) / Math.Pow((HeightInches + HeightFeet * 12), 2)) * 703, 1);
                Console.WriteLine(Result);
                ConsolHelper.BmiResult(Result);


                String lastcommand = Console.ReadLine().ToLower();

                if (lastcommand == "yes")
                {
                    finish = true;
                    Choice();
                }
                else
                {
                    break;
                }
            }
        }
Example #4
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;
            }
        }