Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Based on the previous question. Use a loop to prompt the user to enter the amount sold of each fruit. Once the sales numbers have
Based on the previous question.
Use a loop to prompt the user to enter the amount sold of each fruit. 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.
Module : Assignment Fruit Stand
Working with arrays, parallel array
#include
#include
using namespace std;
int
average
int array;
int main
cout"Welcome to fruit stand!
;
#### fruits ####"orange", "mango", "apple", "pineapple", "banana"####;
#### amountSold #### ;
cout "Please enter the amount of fruit sold
;
for
int i ; i ; i
cout fruits i : ;
cin amountSold i ;
cout An average sold is : average
;
return ;
int averageint array
int total ;
forint i ; i ; i
total array i ;
return total
;
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