Answered step by step
Verified Expert Solution
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
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)
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started