Page 1 of 1

Question 3 (a) (b) Write array declarations for the following: ( ) A list of 150 double-precision coordinate x (1) A lis

Posted: Sun May 15, 2022 1:57 pm
by answerhappygod
Question 3 A B Write Array Declarations For The Following A List Of 150 Double Precision Coordinate X 1 A Lis 1
Question 3 A B Write Array Declarations For The Following A List Of 150 Double Precision Coordinate X 1 A Lis 1 (45.41 KiB) Viewed 58 times
Question 3 (a) (b) Write array declarations for the following: ( ) A list of 150 double-precision coordinate x (1) A list of 12 characters, each representing the initial of months (2 marks) Write the declaration assignment statement to input the following values in a one-dimensional array named power: 100.0, 108.2, 106.4. 104.6, 102.8. After the data has been entered, write the correct notations to access the first and the third clements of the array power. (2 marks) Given the following C++ program that inputs and assigns values into three 2-D arrays A, B, and C. Determine the value in arrays A, B, and C at line 24. You can write the answer of the array in the form of a matrix, for example, 11 2 3] M = 4 5 6 17 8 9 (c) 8 1 #include<iostream> 2 using namespace std; 3 4 int main() 5 { int m= 3; int A[m] [m] = 0; int B[m] [m+1] = 0); 9 int cm+1] [m] = 0); 10 11 int counter = 0, k = 2; 12 13 for (int i=1; i<=m; i++) 14 { 15 for(int j=1; j<=m; j++) 16 17 A[i-1] [i-1] = counter; 18 B[j] = counter; C[j-1] [j-1] = k; 20 ) 21 counter++; k+=3; 23 24 1/Determine the value in array A, B, &C 25 return 0; NOOHNNNNN OSONN 19 22 (6 marks)