Esempio n. 1
0
 public static void InitialPrint(Country[] table)
 {
     HeaderTable.HeaderTable1();
     for (int i = 0; i < table.Length; i++)
     {
         WriteLine($"|{table[i].Name,-15}|{table[i].MonthlyProductionElectricalCurrent.Number.ToString(),30}|");
     }
     HeaderTable.Line(48);
 }
Esempio n. 2
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}");
        }