subject

Modify array elements using other elements. Write a loop that sets each array element to the sum of itself and the next element, except for the last element which stays the same. Be careful not to index beyond the last element.
Ex: Initial scores: 10, 20, 30, 40
Scores after the loop: 30, 50, 70, 40
The first element is 30 or 10 20, the second element is 50 or 20 30, and the third element is 70 or 30 40. The last element remains the same.
1 include ciostream
2 using namespace std;
3
4 int maino
5 const int SCORES SIZE - 4;
6 int bonus Scores[SCORES SIZE);
7 int i;
8
9 for (i = 0; i 10 cin >> bonus Scores[i];
11 >
12
13 /Your solution goes here
14
15 for (1-; i < SCORES. SIZE; ++) {
16 cout << bonus Scores[1] << " ";
17
18 cout << endl;

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:10
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
question
Computers and Technology, 23.06.2019 09:50
Allison and her group have completed the data entry for their spreadsheet project. they are in the process of formatting the data to make it easier to read and understand. the title is located in cell a5. the group has decided to merge cells a3: a7 to attempt to center the title over the data. after the merge, allison points out that it is not centered and looks bad. where would the title appear if allison unmerged the cells in an attempt to fix the title problem?
Answers: 2
question
Computers and Technology, 24.06.2019 02:30
Which option completes the explanation for conflict of interest in an organization
Answers: 1
question
Computers and Technology, 24.06.2019 09:30
Atype of researcher who uses computers to make sense of complex digital data
Answers: 1
You know the right answer?
Modify array elements using other elements. Write a loop that sets each array element to the sum o...
Questions
question
Mathematics, 17.12.2020 04:50
question
Chemistry, 17.12.2020 04:50
question
Mathematics, 17.12.2020 04:50
question
Physics, 17.12.2020 04:50
Questions on the website: 13722363