I have to create a program that accepts 1-10 workers itdoesnt have to be all 10
ID: 3609278 • Letter: I
Question
I have to create a program that accepts 1-10 workers itdoesnt have to be all 10 and their salesAs I said I dont have to accept all the workers I can accept 5 andquit and project their total sales
and earnings
#include<iostream>
using namespace std;
int main()
{
const int SIZE = 10;
double earnings[SIZE];
const int STOP = 99;
double amt;
int person;
cout << "Enter sales made by any of our tensalespeople" << endl <<
"Their sales numbers are digits 1through 10" << endl <<
"You can enter as many money amountsas you want " << endl <<
"for each person in any order"<< endl;
cout << "Enter salesperson number 1 - " <<SIZE << ". Enter " << STOP << " to quit. ";
cin >> person;
while(person = STOP)
{
if(person >= 1 && person<= 10)
{
cout<< "Enter the sale amount ";
cin >>amt;
earnings[person-1] += amt;
}
else
cout << "Number out of range.Please enter another" << endl;
cout << "Enter anothersalesperson number 1 - SIZE or STOP to quit ";
cin >> person;
}
cout << endl << "Salesperson totals are:"<< endl;
for(person = 0; person < SIZE; --person)
cout << "Salesperson " <<(person + 1) << " $" << earnings[person] <<endl;
return 0;
}
Please help me correct this code and make the program run
I have no idea what I did I fooled around with it too much
if you help me i will award lifesaver points thanks