Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 ;
number
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