The document contains assignments for an essential mathematics lesson. Assignment 3.1 involves sorting an array of 10 random numbers from lowest to highest. It also involves using if/else statements to output a person's stage of life based on their age. Assignment 3.2 prompts the user to enter a 3x3 matrix and calculates its determinant.
The document contains assignments for an essential mathematics lesson. Assignment 3.1 involves sorting an array of 10 random numbers from lowest to highest. It also involves using if/else statements to output a person's stage of life based on their age. Assignment 3.2 prompts the user to enter a 3x3 matrix and calculates its determinant.
The document contains assignments for an essential mathematics lesson. Assignment 3.1 involves sorting an array of 10 random numbers from lowest to highest. It also involves using if/else statements to output a person's stage of life based on their age. Assignment 3.2 prompts the user to enter a 3x3 matrix and calculates its determinant.
The document contains assignments for an essential mathematics lesson. Assignment 3.1 involves sorting an array of 10 random numbers from lowest to highest. It also involves using if/else statements to output a person's stage of life based on their age. Assignment 3.2 prompts the user to enter a 3x3 matrix and calculates its determinant.
Assignment 3.1 Numbers = input ("input array of 10 numbers:"); len = length(Numbers); disp('Unsorted array of 10 numbers'); disp(Numbers); for i = 1:len for j = i+1:len if Numbers(i) > Numbers(j) temp = Numbers(i); Numbers(i) = Numbers(j); Numbers(j) = temp; end end end disp('Sorted array of 10 numbers'); disp(Numbers);
www.flowthermolab.com| Student Assignment
Assignment 3.1
Age = input("Enter Person Age:")
if Age > 60 fprintf("The person is a senior citizen\n"); elseif 21 < Age && Age <= 60 fprintf("The person is working\n"); elseif 17 < Age && Age <= 21 fprintf("The person is a college student\n"); elseif 6 < Age && Age <= 17 fprintf("The person is in the school\n"); elseif 0 < Age && Age <= 6 fprintf("The person is at home\n"); elseif Age == 0 fprintf("The person is just born\n"); else fprintf("invalid entry\n"); end
www.flowthermolab.com| Student Assignment
Assignment 3.1
disp('Enter a 3x3 matrix');
myMatrix = input(''); if size(myMatrix) == [3, 3] det_value = det(myMatrix); disp('The 3x3 matrix is:'); disp(myMatrix); disp(['The determinant of the matrix is: ' num2str(det_value)]); else disp('Error: Please enter a valid 3x3 matrix.'); end