#include #include #include /************************************************************************

#include #include #include /******************************************************************************* * List preprocessing directives – you may define your own. *******************************************************************************/ #define MAX_FLIGHTCODE_LEN 6 #define MAX_CITYCODE_LEN 3 #define MAX_NUM_FLIGHTS 5 #define DB_NAME “database” /******************************************************************************* * List structs – you may define struct date and struct studentonly. Each * struct definition should have only the fields mentioned in theassignment * description. *******************************************************************************/ struct date_time { int month; int day; int hour; int minute; }; typedef struct date_time date_time_t; struct flight { char flightcode[MAX_FLIGHTCODE_LEN+1]; date_time_t departure_dt; char arrival_city [MAX_CITYCODE_LEN+1]; date_time_t arrival_t; }; typedef struct flight flight_t; int main() { char second_choice[MAX_CITYCODE_LEN+1]; int i=0; printf(“Enter arrival city code or enter * to show alldestinations>n”); scanf(“%s”,second_choice); if(i==0) { printf(“No flightsn”); } else if(strcmp(second_choice,”*”)==0){ while(i>0) { printf(“something”) i–; printf(“n”); } } else { // some code to compare second_choice to the ” char arrival_city[MAX_CITYCODE_LEN+1] ” member of structure flight_t for everyflight_t type structure in the fligths array.    } } My task was to generate an array of structures called ” flights”. I have managed to create the array and it contains ” i ” numberof flights(the variable i indicates the number of structures storedin the array called flights). The code i have posted is my secondtask. This task requires me to get an input from the user(I havecalled this second_choice) and use this input to dispay either oneof two things. One option is if the user enters ” * “, then”something” is printed, i have managed to do this part. The otheroption is if the user enters a string, for this case i need theprogram to compare this string to the arrival_city member of eachstructure in the flights array. if the string comparison finds amatch, i need the program to print out which structure in the arrayhad the arrival_city equal to the second_choice. If there are nomatches i need the program to print out “no flights”. I am reallystruggling with this, so any help would be appreciated. . . .

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon
"FIRST15"

Order Now