From b668083055ccaf26dad01e274e40887a77071a45 Mon Sep 17 00:00:00 2001 From: James Lawrance Date: Tue, 9 Nov 2021 11:33:58 -0800 Subject: s. --- CST116F2021-Lab6/Functions.cpp | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 CST116F2021-Lab6/Functions.cpp (limited to 'CST116F2021-Lab6/Functions.cpp') 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 -- cgit v1.2.3