You are on page 1of 2

University of Mosul Final Exam.

College: Petroleum & Mining Engineering Time: 3 Hrs.


Dept.: Mining Engineering Date: 24 / 9 / 2020
Class: 1st Year Lecturer: Dr. Sama Talee
Subject: prog1 Code:

Q Marks A) correct the errors


1- m = ali ;
2- '2' and 2 are same in matlab.
3- For n = 10 : -1 : 15
5 For n = 1 : 3
4- case x
Q1 switch 1
5- you can use (disp) as variable name in matlab.
𝑨+𝑩
2 B) rewrite the equation to be accepted in matlab
𝟓𝟐∗𝑨 +𝑩
3 C ) write one condition for 'very good' of mark x1

A) Convert the following program to flowchart


x = input ( ' x = ' );
if x > 6
if x < = 8
z=2*x;
end
z=x^2
else
Q2 7 z=4*x
if x < 3
z=x^3
end
if x < 2
z=x
end
end
B) what is the value of z during run time , if x = 4
A) what is the defferent between source lib. And sink lib. in simulink and
explaine one block for each of them.
B) draw simulation model for
Q3 12 3

∑( 𝑋𝑖 )4 − 8
𝑖=1
University of Mosul Final Exam.
College: Petroleum & Mining Engineering Time: 3 Hrs.
Dept.: Mining Engineering Date: / / 2020
Class: 1st Year Lecturer: Dr. Sama Talee
Subject: prog1 Code:

S = 1;
for i = 2 : 3
S=S*i;
for j = 2: 3
X= i+j;
end
Q4 8 end
A) Determine the values of ( i , j , S , X ) during run time, explane your
answer as table.
B) Choose the correct answer :
1) S = S * i ; will be executed : 5 times , 2 times , 6 times
2) X = i + j ; will be executed : 2 times , 5 times , 4 times

A ) Write matlab program to display Y


Q5 Y= X * Z if X = 3
13
B ) write program to read 5 marks then print count of pass
marks, pass mark is 50 .

Best Wishes

You might also like