Question: Write a program that lets a maker of carbonated drinks keep track of the sales for five different flavors: mint, lime, berry, vanilla, and bacon.

Write a program that lets a maker of carbonated drinks keep track of the sales for five different flavors: mint, lime, berry, vanilla, and bacon. The program shows the names of the top selling flavor that sell more than the average.

Start by using two parallel 5-element arrays*: an array of strings that holds the five carbonated drink flavor names, and an array of integers that holds the number of cans sold during the past month for each flavors. Use a loop to prompt the user to enter the number of cans sold for each flavor. Once the sales numbers have been entered, the program should pass the array holding the sales count to a function that computes and returns the average number of sales. Afterwards, pass both arrays and the average sales value to another function. This function outputs the flavors of top selling drink by iterating over the sales array and outputting the name for each sales count that is equal to or above the average value.

The program must be implemented by using meaningful names for all variables and functions and create prototypes for both functions ABOVE the main. The implementation of both functions must be BELOW the main. Here's an example of how to pass an array to a function:

void print(int array[], const int SIZE); int main() { const int SIZE = 5; int numbers[SIZE] = {1, 2, 3, 4, 5}; print(numbers, SIZE); return 0; } void print(int array[], const int SIZE) { // print array here (details not shown for clarity) }
hello can someone help me with this code in C++ language. Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!