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
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';
}
```
You might also like to view...
Describe the “ideal” file organization scheme to use with classes.
What will be an ideal response?
The factorial of 3 is the same as 2 times the factorial of 2.
Answer the following statement true (T) or false (F)
A slide background fill variation that combines theme colors in different intensities or patterns is called a(n) ________
Fill in the blank(s) with correct word
In a large website that uses CSS, making a formatting revision such as changing the font is very time consuming because each page must be changed individually to use the new font.
Answer the following statement true (T) or false (F)