Cs115 Exercise Set 3
cs104 Exercise Set 10
1. In MatLab an array is declared with which syntax:
a. int [ ] vals;
b. vals = [ 1, 2];
c. array int [ ] vals;
d. array vals = [1,2];;
2. The offset of the first member of an array is:
a. 0
b. 1
c. The size of the array
d. The size of the array minus 1
3. The offset of the last member of an array is:
a. 0
b. 1
c. The size of the array
d. The size of the array minus 1
4. Accessing a member of an array at index 6 is done with:
a. vals[5]
b. vals[6]
c. vals(6)
d. vals{6}
5. Set ASIZE to 5. Write a program that creates an array of ASIZE numeric elements. Prompt the User for ASIZE numbers and store them in the array. After storing the values, calculate the sum of all the values in the array and display the sum.
6. Modify the program you wrote for Problem 5 such that it calculates the product of all the values instead of the sum.
7. Modify the program you wrote in Problem 6 such that it changes the value of each element of the array by multiplying each element of the array by 2, and then displays each element of the array.
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- activity 1 3 3 thermodynamics answer key
- activity 1.3.3 thermodynamics answer key
- act 1 3 3 thermodynamics answer key
- 3 3 t score bone density
- 3 by 3 linear system calculator
- 3 by 3 matrix solver
- 3 by 3 system solver
- 3 by 3 system calculator
- 3 equation 3 unknown solver
- 3 x 3 equation solver
- exercise sentence fragments exercise 1
- set up or set up