1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#include "Header.h"
int main()
{
//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;
}
|