aboutsummaryrefslogtreecommitdiff
path: root/CST116F2021-Lab6/Functions.cpp
diff options
context:
space:
mode:
authorJames Lawrance <[email protected]>2021-11-09 11:33:58 -0800
committerJames Lawrance <[email protected]>2021-11-09 11:33:58 -0800
commitb668083055ccaf26dad01e274e40887a77071a45 (patch)
tree91f4b9b043c205b1038744b5361d4cb9bf29f367 /CST116F2021-Lab6/Functions.cpp
parentAdd online IDE url (diff)
downloadcst116-lab6-jemersonlawrance-b668083055ccaf26dad01e274e40887a77071a45.tar.xz
cst116-lab6-jemersonlawrance-b668083055ccaf26dad01e274e40887a77071a45.zip
s.
Diffstat (limited to 'CST116F2021-Lab6/Functions.cpp')
-rw-r--r--CST116F2021-Lab6/Functions.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/CST116F2021-Lab6/Functions.cpp b/CST116F2021-Lab6/Functions.cpp
new file mode 100644
index 0000000..c9625b0
--- /dev/null
+++ b/CST116F2021-Lab6/Functions.cpp
@@ -0,0 +1,45 @@
+#include "Header.h"
+
+//function getInput definition
+void getInput(string studentClub, string presidentName, int numberOfStudents, string strClubIndex[10][2], int intClubIndex[], int& repeats)
+{
+ strClubIndex[repeats][0] = studentClub;
+ strClubIndex[repeats][1] = presidentName;
+ intClubIndex[repeats] = numberOfStudents;
+}
+
+//function calculateMoney definition
+void calculateMoney(int intClubIndex[], int intClubMoneyIndex[], int repeats)
+{
+ for (int clubCount = 0; clubCount <= repeats; clubCount++)
+ {
+ intClubMoneyIndex[clubCount] = intClubIndex[clubCount] * 75;
+ }
+}
+
+
+
+//function displayTable definition
+void displayTable(string strClubIndex[10][2], int intClubIndex[], int intClubMoneyIndex[], int repeats)
+{
+
+ cout << "\n--Club Table--\n" << endl;
+ cout << "Student Club";
+ cout.width(10);
+ cout << "President";
+ cout.width(10);
+ cout << "Number of Students";
+ cout.width(10);
+ cout << endl;
+
+ for (int i = 0; i < repeats; i++)
+ {
+ cout << "| Club name: " << strClubIndex[i][0]
+ << " | Club President: " << strClubIndex[i][1]
+ << " | Number of Students: " << intClubIndex[i]
+ << " | Club Money: " << intClubMoneyIndex[i] << " |"
+ << endl;
+ }
+
+ cout << endl;
+} \ No newline at end of file