Question: Lab 1 2 : Write a program that keeps track of daily sales of 1 0 stores in an array and determine a ) Highest
Lab :
Write a program that keeps track of daily sales of stores in an array
and determine
a Highest sale and the store number assume that the first store has the store number zero
b Lowest sale and the store number
c Average sale No need to loop to take input multiple times.
input are in order:
output needs to be:
Enter sales numbers:
Highest sales:
Lowest sales:
Average sales:
please help fix my program to pull the last number as the highest number and the first as the lowest number.
#include
#include
#include
using namespace std;
int main
a Array to be searched list
b Number of elements in the array length
c Item that we are searching searchItem
const int size ;
int valuesize;
int index ;
double location ;
bool found false;
int searchItem ;
cout "Enter sales numbers:";
do
cin valueindex;
index;
whileindex size;
while location && index size
if valueindex searchItem
location index;
index;
if found
double highestStoreNumber, lowestStoreNumber;
highestStoreNumber index;
lowestStoreNumber index;
double highestStoreNumber ;
double lowestStoreNumber ;
double total ;
double average;
for int i ; i size; i
if valuei highestStoreNumber
highestStoreNumber valuei;
if valuei lowestStoreNumber
lowestStoreNumber valuei;
total valuei;
average total size;
cout "Highest sales: highestStoreNumber endl;
cout "Lowest sales: lowestStoreNumber endl;
cout "Average sales: average endl;
return ;
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
