Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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 sales

As 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

Explanation / Answer

How many programs do you have due for tomorrow? lol Here you go, mostly stupid mistakes again like last time such asmismatched {} and what not and your while loop had = instead of!= For your array i initialized all the elements to -1 so and throughan if in your display loop so if it sees a -1 it won't disply thatpersons savings since you never used them #include using namespace std; int main() {    const int SIZE = 10;    double earnings[SIZE];    const int STOP = 99;    double amt;    int person;    for (int i = 0; i