Question 1:
a=2.54;
b=3.5;
c=3.9;
d=7;
qA=a^3+sqrt(b*d)-4*c;
disp(qA);
qB=3*b^4-ceil(d/c)+floor(sqrt(a));
disp(qB);
qC=(log(a)*log(b))/exp(c)+abs(5-d);
disp(qC);
qD=exp(ceil(log(12.7)));
disp(qD);
Question 2:
%2(a)
n= input('Enter row & coulumn length for 2a: ');
for r=1:n
if(r==1 || r==n)
for c= 1:n
fprintf('*');
end
else
for c= 1:n
if(c==1 || c==n)
fprintf('*');
else
fprintf(' ')
end
end
end
fprintf('\n')
end
%2(b)
n= input('Enter row & coulumn length for 2b: ');
for r=1:n
for c= 1:n-r
fprintf(' ');
end
for c=1:r
fprintf('*');
end
fprintf('\n');
end
Question 3:
g = 9.8;
v0 = 50.75;
angle = 5*pi/12;
x0 = 0;
y0 = 0;
t = 0: 0.1: 10;
y = y0 - .5*g*t.^2 + (v0*sin(angle))*t;
x = x0 + (v0*cos(angle))*t;
figure(1);
plot(t, y), xlabel('Time in second'), ylabel('y(t) in
meter'), title('y vs. t'), grid on;
figure(2);
plot(t, x), xlabel('Time in second'), ylabel('x(t) in
meter'), title('x vs. t'), grid on;
CSE 330
Numerical Methods
Assignment: 01
Date: 19.02.2019
Name: Tanjim Mostafa
ID: 16201084
Section: 05
Semester: Spring 19
Submitted by:
Submitted to:
Ismail Hossain
Department of Computer Science and Engineering