#include "Header.h" //11a //10.10 Learn by Doing Exercises //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; } //11c //function getStartup definition char getStartup(char userString[]) { cout << "Welcome to the super cool string information program!\n" << endl << "Please enter your string.\n"; cin >> userString; return '0'; } //function isPalindrome definition int isPalindrome(char userString[]) { //initializations char forward[30]; char backward[30]; int length = 0; //calculate length of userString while (userString[length] != '\0') { length++; } //forward to userString, backward to userString backwards strcpy_s(forward, 30, userString); strcpy_s(backward, 30, userString); for (int a = 0, b = (length-1); a < length; a++, b--) { backward[a] = forward[b]; } //compare forward with backward if (strcmp(forward, backward) == 0) { return 1; } else { return 0; } } //function isAlphaStr definition int isAlphaStr(char userString[]) { for (int a = 0; userString[a] != '\0'; a++) { if ((userString[a] < 65 || userString[a] > 90) && (userString[a] < 97 || userString[a] > 122)) { return 0; } } return 1; } //function countChar definition int countChar(char userString[], char& stringCheck) { //initializations int showCt = 0; cout << "\nEnter a character to check number of appearances in your string: "; cin >> stringCheck; for (int a = 0; userString[a] != '\0'; a++) { if (userString[a] == stringCheck) { showCt++; } } return showCt; }