aboutsummaryrefslogtreecommitdiff
path: root/CST116F2021-Lab6/CST116F2021-Lab6.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CST116F2021-Lab6/CST116F2021-Lab6.cpp')
-rw-r--r--CST116F2021-Lab6/CST116F2021-Lab6.cpp56
1 files changed, 39 insertions, 17 deletions
diff --git a/CST116F2021-Lab6/CST116F2021-Lab6.cpp b/CST116F2021-Lab6/CST116F2021-Lab6.cpp
index 466d90f..f2bb35a 100644
--- a/CST116F2021-Lab6/CST116F2021-Lab6.cpp
+++ b/CST116F2021-Lab6/CST116F2021-Lab6.cpp
@@ -1,20 +1,42 @@
-// CST116F2021-Lab6.cpp : This file contains the 'main' function. Program execution begins and ends there.
-//
-
-#include <iostream>
+#include "Header.h"
int main()
{
- std::cout << "Hello World!\n";
-}
-
-// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
-// Debug program: F5 or Debug > Start Debugging menu
-
-// Tips for Getting Started:
-// 1. Use the Solution Explorer window to add/manage files
-// 2. Use the Team Explorer window to connect to source control
-// 3. Use the Output window to see build output and other messages
-// 4. Use the Error List window to view errors
-// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
-// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
+ //definitions
+ string clubName, president;
+ int numberStudents, repeats = 0;
+ string strClubIndex[10][2];
+ int intClubIndex[10], intClubMoneyIndex[10];
+ //greeting
+ cout << "--Student Club Organizer--\n" << endl;
+ //input
+ while (repeats <= 9)
+ {
+ if (repeats == 9)
+ {
+ cout << "\nThis is your final club input slot. The program will end after this input.\n";
+ }
+ cout << "To stop adding club info, enter \"end\".\n"
+ << "Name of club: \n";
+ getline(cin, clubName);
+ if (clubName == "end")
+ {
+ break;
+ }
+ cout << "\nName of club president: \n";
+ getline(cin, president);
+ cout << "\nNumber of students in club: \n";
+ cin >> numberStudents;
+ //fill available slot
+ getInput(clubName, president, numberStudents, strClubIndex, intClubIndex, repeats);
+ cin.ignore();
+ cout << endl;
+ repeats++;
+ }
+ //calculate club money
+ calculateMoney(intClubIndex, intClubMoneyIndex, repeats);
+ //output
+ displayTable(strClubIndex, intClubIndex, intClubMoneyIndex, repeats);
+ //exit
+ return 0;
+} \ No newline at end of file