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 16:30
What type of file does a cookie place on web site visitors' computers so that web site managers can customize their sites to their visitors' preferences?
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
This chapter lists many ways in which becoming computer literate is beneficial. think about what your life will be like once you’re started in your career. what areas of computing will be most important for you to understand? how would an understanding of computer hardware and software you in working from home, working with groups in other countries and contributing your talents.
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
The option enables you to modify a slide element in most presentation applications.
Answers: 2
question
Computers and Technology, 24.06.2019 00:20
The guy wire bd exerts on the telephone pole ac a force p directed along bd. knowing the p must have a 720-n component perpendicular to the pole ac, determine the magnitude of force p and its component along line ac.
Answers: 2
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
Questions on the website: 13722362