diff options
Diffstat (limited to 'CST116F2021-Lab6/Functions.cpp')
| -rw-r--r-- | CST116F2021-Lab6/Functions.cpp | 45 |
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 |