Respuesta :

The loop that subtracts 1  from each element in lowerScores. If the element was already 0 or negative, assign 0 to the element is:

<STUDENT CODE>

for (i = 0; i < SCORES_SIZE; ++i)

  {

// check if the element is already 0 or negative

if (lowerScores[i] < 0)

       {

//assign 0 if the number is negative

lowerScores[i] = 0;

       }

       else if(lowerScores[i] > 0)

       {

            lowerScores[i] = lowerScores[i]-1;

       }

  }

Code:

#include <iostream>

#include <vector>

using namespace std;

int main()

{

  const int SCORES_SIZE = 4;

  vector<int> lowerScores(SCORES_SIZE);

  int i = 0;

 lowerScores.at(0) = 5;

  lowerScores.at(1) = 0;

  lowerScores.at(2) = 2;

  lowerScores.at(3) = -3;

   for (i = 0; i < SCORES_SIZE; ++i)

  {

// check if the element is already 0 or negative

if (lowerScores[i] < 0)

       {

//assign 0 if the number is negative

lowerScores[i] = 0;

       }

       else if(lowerScores[i] > 0)

       {

            lowerScores[i] = lowerScores[i]-1;

       }

  }

    for (i = 0; i < SCORES_SIZE; ++i)

  {

     cout << lowerScores.at(i) << " ";

  }

  cout << endl;

  system("pause");

  return 0;

}

What is a loop?

A loop is a set of instructions in computer programming that is repeatedly repeated until a given condition is met.

Typically, a process is performed, such as retrieving and modifying data, and then a condition is verified, such as whether a counter has reached a predetermined number.

What is an element?

A single component of a bigger group is referred to as an element. In computer programming, for example, an array can include various items (indices) that can be stored and called on independently.

Learn more about loop:
https://brainly.com/question/26568485
#SPJ1