Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using ConsoleTables;
- namespace jarodZumbaAssignment
- {
- class zumba
- {
- public void DisplayZumba()
- {
- Console.Clear();
- createTable();
- }
- public static string[] days()
- {
- string[] daysarray = new string[] { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
- return daysarray;
- }
- public static string[] times()
- {
- string[] timesarray = new string[] { "1:00", "3:00", "5:00", "7:00" };
- return timesarray;
- }
- public static int[,] attendance()
- {
- int[,] array2 = { { 12, 10, 17, 22},
- { 11, 13, 17, 22},
- { 12, 10, 22, 22},
- { 09, 14, 17, 22},
- { 12, 10, 21, 12},
- { 12, 10, 05, 10} };
- return array2;
- }
- public static void createTable()
- {
- string[] dayArr = days();
- string[] timesArr = times();
- int[,] attendArr = attendance();
- int OneTot = 0;
- for (int i = 0; i < 6; i++)
- {
- OneTot += attendArr[i, 0];
- }
- int ThreeTot = 0;
- for (int i = 0; i < 6; i++)
- {
- ThreeTot += attendArr[i, 1];
- }
- int FiveTot = 0;
- for (int i = 0; i < 6; i++)
- {
- FiveTot += attendArr[i, 2];
- }
- int SevTot = 0;
- for (int i = 0; i < 6; i++)
- {
- SevTot += attendArr[i, 3];
- }
- int AttTtl = OneTot + ThreeTot + FiveTot + SevTot;
- var table = new ConsoleTable("", "", "", "Zumba", "", "", "");
- table.AddRow("", timesArr[0], timesArr[1], timesArr[2], timesArr[3], "", "");
- table.AddRow(dayArr[0], attendArr[0, 0], attendArr[0, 1], attendArr[0, 2], attendArr[0, 3], "", "");
- table.AddRow(dayArr[1], attendArr[1, 0], attendArr[1, 1], attendArr[1, 2], attendArr[1, 3], "", "");
- table.AddRow(dayArr[2], attendArr[2, 0], attendArr[2, 1], attendArr[2, 2], attendArr[2, 3], "", "");
- table.AddRow(dayArr[3], attendArr[3, 0], attendArr[3, 1], attendArr[3, 2], attendArr[3, 3], "", "");
- table.AddRow(dayArr[4], attendArr[4, 0], attendArr[4, 1], attendArr[4, 2], attendArr[4, 3], "", "");
- table.AddRow(dayArr[5], attendArr[5, 0], attendArr[5, 1], attendArr[5, 2], attendArr[5, 3], "", "");
- table.AddRow("Hourly Att.", OneTot, ThreeTot, FiveTot, SevTot, AttTtl, "");
- table.Write();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement