#include <iostream>
usingnamespace std;
int main() {
constint NUM_ELEMENTS = 8; // Number of elements
int userVals[NUM_ELEMENTS]; // User numbers
int i = 0; // Loop index
int sumVal = 0; // For computing sum
// Prompt user to populate array
cout << "Enter " << NUM_ELEMENTS << " integer values..." << endl;
for (i = 0; i <= NUM_ELEMENTS; ++i) {
cout << "Value: " << endl;
cin >> userVals[i];
}
// Determine sum
sumVal = 0;
for (i = 0; i < NUM_ELEMENTS; ++i) {
sumVal = sumVal + userVals[i];
}
cout << "Sum: " << sumVal << endl;
// Print the numbers greater than 21 and what I added
cout << endl<< "Numbers greater than 21: " << endl;
for (i = 0; i < NUM_ELEMENTS; ++i){
if (userVals[i] > 21){
cout << endl;
}
}
return 0;
}