Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.90 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using ConsoleTables;
  7.  
  8. namespace jarodZumbaAssignment
  9. {
  10.     class zumba
  11.     {
  12.  
  13.  
  14.         public void DisplayZumba()
  15.         {
  16.             Console.Clear();
  17.             createTable();
  18.  
  19.  
  20.         }
  21.  
  22.         public static string[] days()
  23.         {
  24.             string[] daysarray = new string[] { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
  25.             return daysarray;
  26.         }
  27.  
  28.         public static string[] times()
  29.         {
  30.             string[] timesarray = new string[] { "1:00", "3:00", "5:00", "7:00" };
  31.             return timesarray;
  32.         }
  33.  
  34.         public static int[,] attendance()
  35.         {
  36.             int[,] array2 = { { 12, 10, 17, 22},
  37.                               { 11, 13, 17, 22},
  38.                               { 12, 10, 22, 22},
  39.                               { 09, 14, 17, 22},
  40.                               { 12, 10, 21, 12},
  41.                               { 12, 10, 05, 10} };
  42.  
  43.             return array2;
  44.         }
  45.  
  46.  
  47.         public static void createTable()
  48.         {
  49.             string[] dayArr = days();
  50.             string[] timesArr = times();
  51.             int[,] attendArr = attendance();
  52.  
  53.             int OneTot = 0;
  54.  
  55.             for (int i = 0; i < 6; i++)
  56.             {
  57.                 OneTot += attendArr[i, 0];
  58.             }
  59.  
  60.             int ThreeTot = 0;
  61.  
  62.             for (int i = 0; i < 6; i++)
  63.             {
  64.                 ThreeTot += attendArr[i, 1];
  65.             }
  66.  
  67.             int FiveTot = 0;
  68.  
  69.             for (int i = 0; i < 6; i++)
  70.             {
  71.                 FiveTot += attendArr[i, 2];
  72.             }
  73.  
  74.             int SevTot = 0;
  75.  
  76.             for (int i = 0; i < 6; i++)
  77.             {
  78.                 SevTot += attendArr[i, 3];
  79.             }
  80.  
  81.             int AttTtl = OneTot + ThreeTot + FiveTot + SevTot;
  82.  
  83.  
  84.             var table = new ConsoleTable("", "", "", "Zumba", "", "", "");
  85.             table.AddRow("", timesArr[0], timesArr[1], timesArr[2], timesArr[3], "", "");
  86.             table.AddRow(dayArr[0], attendArr[0, 0], attendArr[0, 1], attendArr[0, 2], attendArr[0, 3], "", "");
  87.             table.AddRow(dayArr[1], attendArr[1, 0], attendArr[1, 1], attendArr[1, 2], attendArr[1, 3], "", "");
  88.             table.AddRow(dayArr[2], attendArr[2, 0], attendArr[2, 1], attendArr[2, 2], attendArr[2, 3], "", "");
  89.             table.AddRow(dayArr[3], attendArr[3, 0], attendArr[3, 1], attendArr[3, 2], attendArr[3, 3], "", "");
  90.             table.AddRow(dayArr[4], attendArr[4, 0], attendArr[4, 1], attendArr[4, 2], attendArr[4, 3], "", "");
  91.             table.AddRow(dayArr[5], attendArr[5, 0], attendArr[5, 1], attendArr[5, 2], attendArr[5, 3], "", "");
  92.             table.AddRow("Hourly Att.", OneTot, ThreeTot, FiveTot, SevTot, AttTtl, "");
  93.  
  94.  
  95.             table.Write();
  96.  
  97.         }
  98.     }
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement