Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
