#include #include #include struct initials { char first_initial; char last_initial; }; // Return the total number of structs that DON'T // have both initials set to capital letters int struct_capitals(int size, struct initials array[]) { //TODO // I need a loop to go to the entire array's elements int i = 0; int count = 0; while(i < size) { if (array[i].first_initial >= 'A' && array[i].first_initial <= 'Z' && array[i].last_initial >= 'A' && array[i].last_initial <= 'Z') { // if (isupper(array[i].first_initial) && // isupper(array[i].last_initial)) count++; } i++; } return size - count; } // This is a simple main function which could be used // to test your struct_capitals function. // It will not be marked. // Only your struct_capitals function will be marked. #define TEST_ARRAY_SIZE 5 int main(void) { struct initials test_array[TEST_ARRAY_SIZE] = { { .first_initial = 'A', .last_initial = 'F'}, { .first_initial = '!', .last_initial = 'Z'}, { .first_initial = 'Z', .last_initial = 'X'}, { .first_initial = 'N', .last_initial = 's'}, { .first_initial = 't', .last_initial = 'a'} }; printf("%d\n", struct_capitals(TEST_ARRAY_SIZE, test_array)); return 0; }