Write statements that perform the following one-di- mensional array operations:

a) Initialize the 10 elements of integer array counts to zero.
b) Add 1 to each of the 15 elements of integer array bonus.
c) Read 12 values for the array of doubles named monthlyTemperatures from the key- board.
d) Print the 5 values of integer array bestScores in column format.

```
a) array t{};
b)
for (int i{0}; i < 15; ++i) {
++bonus[i];
}
or
for (int& element : bonus) {
++element;
}
c)
for (int p{0}; p < 12; ++p) {
cin >> monthlyTemperatures[p];
}

or

for (int& element : monthlyTemperatures) {
cin >> element;
}
d)
for (int u{0}; u < 5; ++u) {
cout << bestScores[u] << '\t';
}
or
for (int element : bestScores) {
cout << element << '\t';
}
```

Computer Science & Information Technology

You might also like to view...

There are four main sections of a report

Indicate whether the statement is true or false

Computer Science & Information Technology

When information (such as a title) spans more than one column in a table, those cells should be ________

Fill in the blank(s) with correct word

Computer Science & Information Technology