Assignment Smq1024
Assignment Smq1024
simple code using a script file. Submit to me the softcopy of your results.
The softcopy should be a written report done in Microsoft Word that consists
of the script files and output on each questions. The submission is done via
MyGuru2. The assignment is due on Friday, 1 February 2013 at 4pm. You
are required to write the code on your own. You may discuss with your friend
but if you are caught copying others work, no marks will be given to both
party.
[10 marks]
Answer:
Code:-
console:
[10 marks]
Answer:
Code:-
if (BMI<19) then
y=(' considered underweight');
elseif (BMI>=19) & (BMI<=25)
y=('considered healthy ');
elseif (BMI>25)
y=('considered overweight');
end
mprintf('your BMI is %i,this is %s.\n',BMI,y);
console:
[10 marks]
Code:-
n1 = 1;
n2 = 1;
for count = 3:term
fib = n1 + n2;
mprintf(', %i', fib);
n2 = n1;
n1 = fib;
end
mprintf('.\n');
console: