1. Please create an array of size 3x3 with the values shown below. At the same time, the user will key in the x- and y-position and the program should output the value in that position.
[
2.3 5.2 2
0 −1.5 2.7
0 3 1.8
]
**************************
Example Input:
X-Position? 2
Y-Position? 1
Example Output: X=2 and Y=1:
The value is 3.
**************************
2. Please create an array of size 3x3 with the values shown below. By inputting two sets of X- and Y-Position, the value for these two positions should exchange. Use the program in Q.1 to check your answer.
[
2.3 5.2 2
0 −1.5 2.7
0 3 1.8
]
**************************
Example Input:
Data Set 1, X-Position? 2
Data Set 1, Y-Position? 1
Data Set 2, X-Position? 1
Data Set 2, Y-Position? 1
Example Output:
X=2 and Y=1: The old value was 3 and now it is 0.
X=1 and Y=1: The old value was 0 and now it is 3.
**************************