# Double any element's value that is less than minValue. Ex: If minValue = 10, then dataPoints = {2, 12, 9, 20} becomes {4, 12, 18, 20}. #include <iostream>using namespace std; int main() {const int NUM_POINTS = 4;int dataPoints[NUM_POINTS];int minValue;int i; cin >> minValue; for (i = 0; i < NUM_POINTS; ++i) {cin >> dataPoints[i];} /* Your solution goes here */ for (i = 0; i < NUM_POINTS; ++i) {cout << dataPoints[i] << " " ;}cout << endl; return 0;} Please help me with this problem using c++.

Question

Double any element's value that is less than minValue. Ex: If minValue = 10, then dataPoints = {2, 12, 9, 20} becomes {4, 12, 18, 20}.

#include <iostream>
using namespace std;

int main() {
const int NUM_POINTS = 4;
int dataPoints[NUM_POINTS];
int minValue;
int i;

cin >> minValue;

for (i = 0; i < NUM_POINTS; ++i) {
cin >> dataPoints[i];
}

/* Your solution goes here */

for (i = 0; i < NUM_POINTS; ++i) {
cout << dataPoints[i] << " " ;
}
cout << endl;

return 0;
}

### Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science