/// <summary> /// Print the chart on the screen. /// </summary> /// <param name="HeightOnChart">The user's height value on the chart.</param> /// <param name="WeightOnChart">The user's weight value on the chart.</param> public static void PrintChart(int HeightOnChart, int WeightOnChart) { for (int i = 0; i < HEIGHT; i++) { for (int j = 0; j < LENGTH; j++) { /** * Change the text collor for the weight and height values. */ if ((i == 0) || (j == 0) || (i == 1) || (j == 1)) { Console.ForegroundColor = ConsoleColor.DarkGray; } else if ((i > MIN_ROW - 1) && (j > MIN_COL - 1)) { CollorChanger.ChangeColor(BmiChart[i, j]); } //Highlight the user's bmi if ((i == HeightOnChart) && (j == WeightOnChart)) { Console.ForegroundColor = ConsoleColor.White; } Console.Write(BmiChart[i, j]); } Console.WriteLine(""); } }
/// <summary> /// Explain the chart and display user's bmi. /// </summary> private void PrintChartDetails() { Console.WriteLine("\n\tWHO (World Health Organisation) weight status as illustrated below:\n"); CollorChanger.ChangeColor(E_OBESE); Console.WriteLine($"\n\t{EnumHelper<Categories>.GetName(Categories.E_OBESE)}"); CollorChanger.ChangeColor(OBESE); Console.WriteLine($"\n\t{EnumHelper<Categories>.GetName(Categories.OBESE)}"); CollorChanger.ChangeColor(OVERWEIGHT); Console.WriteLine($"\n\t{EnumHelper<Categories>.GetName(Categories.OVERWEIGHT)}"); CollorChanger.ChangeColor(HEALTHY); Console.WriteLine($"\n\t{EnumHelper<Categories>.GetName(Categories.HEALTHY)}"); CollorChanger.ChangeColor(UNDERWEIGHT); Console.WriteLine($"\n\t{EnumHelper<Categories>.GetName(Categories.UNDERWEIGHT)}"); }