values terminated by -11, the program should assign -10 to all elements of the array and stop the reading from the standard input. (20 points) 2. Define a non-void function O_F2_6 that takes a 1D...


with in 20 min .i had no time left ,You can skip if had no knowledge


Don't copy from internet else i downvote .



values terminated by -11, the program should assign -10 to all elements of the array and stop<br>the reading from the standard input. (20 points)<br>2. Define a non-void function O_F2_6 that takes a 1D array arr as formal parameter. The array arr<br>represents the number of trips for each flight per passenger. The function calculates and returns<br>the average number of trips. (15 points)<br>3. Define a non-void function O_F3_6 that takes three formal parameters: a 10 array arr of size<br>FLIGHT_SIZE, a 1D array IDs_flights of size FLIGHT_SIZE and the number of trips num_trips. The<br>array arr represents the number of trips for each fight per passenger. The function should<br>search for num_trips in arr and return the flight Id corresponding to the first occurrence of<br>num_trips if found; otherwise, returns -1. (20 points)<br>Part 2:<br>4. Define a void function O_F4_6 that takes one 2D array Flight_frequency and two 1D arrays,<br>IDs passengers and Freq_flyers as formal parameters. The function should fill the Freq_flyers<br>with the frequent flyer character value for each passenger according to the following table. The<br>function then prints the frequent flyer description for each passenger, as shown in sample<br>output below. (20 points)<br>Sum of trips<br>Frequent flyer Frequent flyer description<br>< 250<br>Regular<br>Silver<br>>=250 and <=1150<br>>1150 and < 2150<br>Platinum<br>5. Write a main function to do the following by using the above functions: (25 points)<br>Declare and initialize the array Freq_fyers with 'f.<br>• Declare and initialize the arrays IDs_passengers, IDs_flights, and Flight_frequency with -14.<br>• Prompt the user to initialize the arrays IDs_passengers and IDs_flights. Note that when the<br>user enters -11, the main function should stop reading and assign -10 to the remaining<br>elements of the array.<br>• Prompt the user to initialize the array Flight_frequency by calling 0_F1_6 for every row in the<br>20 array. If user enters -11, the main function should fill the remaining elements of the array<br>with -10.<br>• Call O_F2_6 for every row in the 20 array and print the average trips for each passenger<br>returned as in sample output below.<br>• Call O_F4_6 to find out and print the frequent flyer descriptions for each passenger.<br>Prompt the user to enter passenger ID and frequency (number) of trips for a fight and call<br>O_F3_6 to find the flight ID and print it. If passenger ID or frequency of trips is not found, it<br>should display a message that required information is not found.<br>• The main function should run successfully with different scenarios.<br>

Extracted text: values terminated by -11, the program should assign -10 to all elements of the array and stop the reading from the standard input. (20 points) 2. Define a non-void function O_F2_6 that takes a 1D array arr as formal parameter. The array arr represents the number of trips for each flight per passenger. The function calculates and returns the average number of trips. (15 points) 3. Define a non-void function O_F3_6 that takes three formal parameters: a 10 array arr of size FLIGHT_SIZE, a 1D array IDs_flights of size FLIGHT_SIZE and the number of trips num_trips. The array arr represents the number of trips for each fight per passenger. The function should search for num_trips in arr and return the flight Id corresponding to the first occurrence of num_trips if found; otherwise, returns -1. (20 points) Part 2: 4. Define a void function O_F4_6 that takes one 2D array Flight_frequency and two 1D arrays, IDs passengers and Freq_flyers as formal parameters. The function should fill the Freq_flyers with the frequent flyer character value for each passenger according to the following table. The function then prints the frequent flyer description for each passenger, as shown in sample output below. (20 points) Sum of trips Frequent flyer Frequent flyer description < 250="" regular="" silver="">=250 and <=1150>1150 and < 2150="" platinum="" 5.="" write="" a="" main="" function="" to="" do="" the="" following="" by="" using="" the="" above="" functions:="" (25="" points)="" declare="" and="" initialize="" the="" array="" freq_fyers="" with="" 'f.="" •="" declare="" and="" initialize="" the="" arrays="" ids_passengers,="" ids_flights,="" and="" flight_frequency="" with="" -14.="" •="" prompt="" the="" user="" to="" initialize="" the="" arrays="" ids_passengers="" and="" ids_flights.="" note="" that="" when="" the="" user="" enters="" -11,="" the="" main="" function="" should="" stop="" reading="" and="" assign="" -10="" to="" the="" remaining="" elements="" of="" the="" array.="" •="" prompt="" the="" user="" to="" initialize="" the="" array="" flight_frequency="" by="" calling="" 0_f1_6="" for="" every="" row="" in="" the="" 20="" array.="" if="" user="" enters="" -11,="" the="" main="" function="" should="" fill="" the="" remaining="" elements="" of="" the="" array="" with="" -10.="" •="" call="" o_f2_6="" for="" every="" row="" in="" the="" 20="" array="" and="" print="" the="" average="" trips="" for="" each="" passenger="" returned="" as="" in="" sample="" output="" below.="" •="" call="" o_f4_6="" to="" find="" out="" and="" print="" the="" frequent="" flyer="" descriptions="" for="" each="" passenger.="" prompt="" the="" user="" to="" enter="" passenger="" id="" and="" frequency="" (number)="" of="" trips="" for="" a="" fight="" and="" call="" o_f3_6="" to="" find="" the="" flight="" id="" and="" print="" it.="" if="" passenger="" id="" or="" frequency="" of="" trips="" is="" not="" found,="" it="" should="" display="" a="" message="" that="" required="" information="" is="" not="" found.="" •="" the="" main="" function="" should="" run="" successfully="" with="" different="">
Write a C program to keep track of frequency of flights (number of trips per flight) taken by different<br>passengers of an airlines company. You are not allowed to use array index notation in the program.<br>Instead, you must use a pointer notation to access different elements of an array. A while loop and<br>a do/while loop are not allowed to be used in the main function. The program design should use<br>main and the below functions.<br>Consider the constant PASSENGER_SIZE with value equal to 7 and FLIGHT_SIZE with value equal to<br>6. We consider in the program the following arrays named as follows:<br>IDs passengers: is a 1D array of integer of size PASSENGER_SIZE that stores the IDs of passengers.<br>Each passenger should have a unique positive ID.<br>IDs_flights: is a 1D array of integer of size FLIGHT_SIZE that stores the IDs of different flights. Each<br>flight should have a unique positive ID.<br>Filight_frequency: is a 20 array with size equal to PASSENGER_SIZE x FLIGHT_SIZE that stores the<br>number of trips for each flight per passenger. The number of trips should be greater or equal to<br>zero. The number of rows will represent the number of passengers while the number of the columns<br>represent the number of flights. In the following example, the passenger with ID = 33 (Row index<br>=0) has 5 trips for flight ID = 222 (Column index = 0), 7 trips for filight ID = 333 (Column index =1),<br>etc.<br>Freq_flyers: is a 1D array of character with size equal to PASSENGER_SIZE that stores the frequent<br>flyer for each passenger. 'P' for Platinum, 'S' for Silver, or 'R' for Regular.<br>222<br>333<br>444<br>555<br>666 | 777<br>IDs_flights<br>2<br>3<br>4<br>in<br>33<br>R<br>7<br>44<br>5.<br>250<br>7<br>55<br>50<br>500<br>100<br>100<br>3<br>66<br>R<br>3<br>2<br>5<br>8<br>8<br>6.<br>77<br>4.<br>200<br>200<br>25<br>25<br>26<br>50<br>88<br>R<br>6.<br>7<br>4<br>99<br>R<br>7<br>8.<br>9.<br>6.<br>3<br>2<br>IDs _passengers<br>Freq_flyers<br>Flight_frequency<br>Part 1:<br>1. Define a void function O_F1_6 that takes a 1D array of integer arr and the size of the array N as<br>formal parameters. The array arr represents the number of trips for N flights per passenger. The<br>function should prompt the user to fill<br>If the user enters -11, the function should stop reading and assign -10 to all elements of the<br>array arr. For example, if the user enters successfully one, two, or three values from FLIGHT_SIZE<br>array arr with number of trips until user enters -11<br>N00 n<br>

Extracted text: Write a C program to keep track of frequency of flights (number of trips per flight) taken by different passengers of an airlines company. You are not allowed to use array index notation in the program. Instead, you must use a pointer notation to access different elements of an array. A while loop and a do/while loop are not allowed to be used in the main function. The program design should use main and the below functions. Consider the constant PASSENGER_SIZE with value equal to 7 and FLIGHT_SIZE with value equal to 6. We consider in the program the following arrays named as follows: IDs passengers: is a 1D array of integer of size PASSENGER_SIZE that stores the IDs of passengers. Each passenger should have a unique positive ID. IDs_flights: is a 1D array of integer of size FLIGHT_SIZE that stores the IDs of different flights. Each flight should have a unique positive ID. Filight_frequency: is a 20 array with size equal to PASSENGER_SIZE x FLIGHT_SIZE that stores the number of trips for each flight per passenger. The number of trips should be greater or equal to zero. The number of rows will represent the number of passengers while the number of the columns represent the number of flights. In the following example, the passenger with ID = 33 (Row index =0) has 5 trips for flight ID = 222 (Column index = 0), 7 trips for filight ID = 333 (Column index =1), etc. Freq_flyers: is a 1D array of character with size equal to PASSENGER_SIZE that stores the frequent flyer for each passenger. 'P' for Platinum, 'S' for Silver, or 'R' for Regular. 222 333 444 555 666 | 777 IDs_flights 2 3 4 in 33 R 7 44 5. 250 7 55 50 500 100 100 3 66 R 3 2 5 8 8 6. 77 4. 200 200 25 25 26 50 88 R 6. 7 4 99 R 7 8. 9. 6. 3 2 IDs _passengers Freq_flyers Flight_frequency Part 1: 1. Define a void function O_F1_6 that takes a 1D array of integer arr and the size of the array N as formal parameters. The array arr represents the number of trips for N flights per passenger. The function should prompt the user to fill If the user enters -11, the function should stop reading and assign -10 to all elements of the array arr. For example, if the user enters successfully one, two, or three values from FLIGHT_SIZE array arr with number of trips until user enters -11 N00 n

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here