Answer:
Check the explanation
Explanation:
MATLAB code:
%----------------------
function result = dominant(A)
% matrix dimensions
d = size(A);
% for loop over rows
for i = 1:d
% sum of row elements except diagonal element
sum_row =0;
% for loop over columns
for j = 1:d
% adding each elements to sum variable
sum_row = sum_row+ abs(A(i,j));
end
%subratcting diagonal element
sum_row = sum_row-abs(A(i,i));
%checking dominant condition
% failed once means matrix is not diagonal dominant
if abs(A(i,i))< sum_row
result = 'false';
return;
end
end
% dominant condition not failed
result = 'true';
end
% matrix A
A = [ 3 -2 1; 1 -3 2; 1 2 6]
% result
result = dominant(A)
% matrix A
A = [ -2 1 2; 1 3 2; 1 -2 0]
% result
result = dominant(A)
%----------------------
Kindly check the attached output image below.
Answer:
Can't draw a flow chart here, but here are the steps you need:
1) Prompt for side length of cube
2) If the entry is non-numeric, give error and go to step 1
3) If the entry is less than zero, give error and go to step 1
4) output "Volume is " + (entry * entry * entry)
5) output "Surface area is " + (6 * entry * entry)
6) Prompt for calculating another cube
7) If the reply is "y", go to step 1
8) end