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, 23.06.2019 02:00
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = βˆ’a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
question
Computers and Technology, 24.06.2019 08:20
Which type of entity describes a fundamental business aspect of a database? a. linking b. lookup c. domain d. weak
Answers: 3
question
Computers and Technology, 24.06.2019 08:30
@josethesolis i need can anyone text me and follow me
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, 28.08.2020 22:01
question
Mathematics, 28.08.2020 22:01
question
Mathematics, 28.08.2020 22:01
Questions on the website: 13722367