示例#1
0
        public static void PrintElectricity(Country[] table)
        {
            HeaderTable.HeaderTable2();
            long   totalProductionElectricity = 0;
            double procent = 0.0;

            for (int i = 0; i < table.Length; i++)
            {
                totalProductionElectricity += table[i].MonthlyProductionElectricalCurrent.Number;
            }

            for (int i = 0; i < table.Length; i++)
            {
                procent = table[i].CalculateProcentFromTotalElectricalCurent(totalProductionElectricity);
                Console.WriteLine($"|{table[i].Name,-14}|{table[i].MonthlyProductionElectricalCurrent.Number.ToString(),31}|{procent.ToString("F"),-8}|");
            }
            HeaderTable.Line(57);
            Console.WriteLine($"\t\t\tTotal: {totalProductionElectricity}");
        }