subject
Computers and Technology, 17.08.2021 04:50 davia97

Write a loop that subtracts 1 from each element in lowerScores. If the element was already 0 or negative, assign 0 to the element. Ex: lowerScores = {5, 0, 2, -3} becomes {4, 0, 1, 0}. Sample program:
#include
using namespace std;
int main() {
const int SCORES_SIZE = 4;
vector 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) {
cout << lowerScores. at(i) << " ";
}
cout << endl;
return 0;
}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:00
Create a cell reference in a formula by typing in the cell name or         a. right-clicking the cell. b. clicking the cell. c. clicking the column where the cell is located. d. clicking the row where the cell is located.
Answers: 1
question
Computers and Technology, 22.06.2019 17:00
Annie is creating a corporate report for a company’s annual meeting. in the report, she wants to add the signature of various department heads. which device can annie use to capture signatures to include in the report? a. printer b. monitor c. e-reader d. digitizing tablet
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Determine whether the following careers would require training or college.
Answers: 1
question
Computers and Technology, 23.06.2019 07:50
Most shops require the technician to enter a starting and ending time on the repair order to track the actual time the vehicle was in the shop and closed out by the office. this time is referred to as _ time ? a. comeback b. ro c. cycle d. lead
Answers: 1
You know the right answer?
Write a loop that subtracts 1 from each element in lowerScores. If the element was already 0 or nega...
Questions
question
Mathematics, 25.11.2021 09:50
question
English, 25.11.2021 09:50
question
Mathematics, 25.11.2021 09:50
question
Mathematics, 25.11.2021 14:00