Answer:
The solution code is written in Java.
- double [] alpha = new double[50];
-
- for(int i =0; i < 25; i++){
- alpha[i] = i * i;
- }
-
- for(int j = 25; j < 50; j++){
- alpha[j] = j * 3;
- }
Step-by-step explanation:
Firstly, the syntax to declare an array variable alpha of type double and initialize it with 50 components is presented in Line 1.
Next, use a for-loop to traverse through the first 25 components (Line 3). Use * operator to multiply index variable by itself (to square it) and assign it to the current component of the alpha array (Line 4).
Create another for-loop to traverse through the last 25 components (Line 7). This time, multiply the index variable with 3 and assign it to the current component of the alpha array (Line 8).