Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello can someone help me with this, how to solve it. with C++ langauge. Thank you Write a program that lets a maker of carbonated

Hello can someone help me with this, how to solve it. with C++ langauge.
Thank you image text in transcribed
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)
}
using namespace std; sint max(int arr[]). A Unused variable 'index 7 Ant 1. index; 0 int max = arr[]; 10 11 12 for (i = 1; i max) 15 max arr[i]; 16 ) 17 18 return max) 19 ) 70 int minimumint arr[ 1) 22 Int 1, index: 23 24 int mini-arro): 25 26 27 for (i 1 * 37 Mint main() Enter the number of roops sold for each flavor for the month Vanilla 17 chocolate 14 cookie dough 19 mint 110 strawberTv112

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

LO3 Name the seven categories of HR functions.

Answered: 1 week ago