Answer:
Following are the code to this question:
for(i=0;i<dataPoints.length;++i) //define loop to count array element
{
if(dataPoints[i]<minValue) // define condition that checks array element is less then minValue
{
dataPoints[i] = dataPoints[i]*2; //double the value
}
}
Step-by-step explanation:
Description of the code as follows:
- In the given code, a for loop is declared, that uses a variable "i", which counts all array element, that is input by the user.
- Inside the loop and if block statement is used, that check array element value is less then "minValue", if this condition is true.
- So, inside the loop, we multiply the value by 2.