Write a program that lets the ice cream store keep track the sales of five different flavors: chocolate, vanilla, strawberry, mint, and lemon. The program shows the flavor names of the good selling that sell more than the average. Start by using two parallel 5-element arrays*: an array of strings that holds the five flavor names, and an array of integers that holds the number of amount sold during the past month for each ice cream flavor. Use a loop to prompt the user to enter the number of each flavor sold. Create an function that computes an average. 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. Create a second function: afterwards, pass both arrays and the average sales value to another function. This function outputs the ice cream flavor that sale more than the average by iterating over the sales array and outputting the name for each sales count that is less than the average value. The program must have your name in the source file. 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) }
Write a program that lets the ice cream store keep track the sales of five different flavors: chocolate, vanilla, strawberry, mint, and lemon. The program shows the flavor names of the good selling that sell more than the average. Start by using two parallel 5-element arrays*: an array of strings that holds the five flavor names, and an array of integers that holds the number of amount sold during the past month for each ice cream flavor. Use a loop to prompt the user to enter the number of each flavor sold. Create an function that computes an average. 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. Create a second function: afterwards, pass both arrays and the average sales value to another function. This function outputs the ice cream flavor that sale more than the average by iterating over the sales array and outputting the name for each sales count that is less than the average value. The program must have your name in the source file. 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) }
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
C++
![Write a program that lets the ice cream store keep track the sales of five different
flavors: chocolate, vanilla, strawberry, mint, and lemon. The program shows the
flavor names of the good selling that sell more than the average.
Start by using two parallel 5-element arrays*: an array of strings that holds the five
flavor names, and an array of integers that holds the number of amount sold during
the past month for each ice cream flavor. Use a loop to prompt the user to enter
the number of each flavor sold. Create an function that computes an average. 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. Create a second function: afterwards, pass both arrays and the average sales
value to another function. This function outputs the ice cream flavor that sale more
than the average by iterating over the sales array and outputting the name for each
sales count that is less than the average value.
The program must have your name in the source file. 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)
}](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fdd27f7e0-834e-40ed-ac12-9ff71783ae4a%2Fc53aa6e7-c04f-4371-8b30-2f069b084099%2F0jdk4ka_processed.png&w=3840&q=75)
Transcribed Image Text:Write a program that lets the ice cream store keep track the sales of five different
flavors: chocolate, vanilla, strawberry, mint, and lemon. The program shows the
flavor names of the good selling that sell more than the average.
Start by using two parallel 5-element arrays*: an array of strings that holds the five
flavor names, and an array of integers that holds the number of amount sold during
the past month for each ice cream flavor. Use a loop to prompt the user to enter
the number of each flavor sold. Create an function that computes an average. 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. Create a second function: afterwards, pass both arrays and the average sales
value to another function. This function outputs the ice cream flavor that sale more
than the average by iterating over the sales array and outputting the name for each
sales count that is less than the average value.
The program must have your name in the source file. 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)
}
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 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

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education