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 ar 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 fiyer description < 250 R Regular Silver >=250 and <=1150 >1150 and < 2150 Platinum
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 ar 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 fiyer description < 250 R Regular Silver >=250 and <=1150 >1150 and < 2150 Platinum
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 6PP: (Numerical) a. Define an array with a maximum of 20 integer values, and fill the array with numbers...
Related questions
Question
with in 20 min .i had no time left ,You can skip if had no knowledge
Don't copy from internet else i downvote .
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 9 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr