0% found this document useful (0 votes)
4 views6 pages

C141 Math102 FinalExamModelAnswers

Uploaded by

Mohamed Fazzaa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views6 pages

C141 Math102 FinalExamModelAnswers

Uploaded by

Mohamed Fazzaa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Year: 1441/1442 First semester

Course title: Introduction to Computer King Faisal University


Sciences
Course code: 0827102 Faculty of Science
Date: Thursday : 9/5/1442
24/12/2020
Department of Mathematics and
Time: 7:30—9:00 1.5 Hours
Sec. No.: Statistics
Exam Mark 40

A simple calculator with only four basic operations (addition, subtraction, multiplication and division)
is allowed. The use of a scientific calculator and mobile are not permitted.

Final Exam (C141FinalExam)


Introduction to Computer Sciences (Math 102 )

Name:
Acad. No.:

Don’t type anything in the following table.


CLO First Part Second Part (one mark per Q) Total
/Per
Q1 Q2 Q3 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14
CLO
1.1
Know.

/3 /13
1.2 /4
2.1
Skills

/4 /3 /7
Second Part (one mark per Q)
Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22 Q23 Q24 Q25 Q26 Q27 Q28 Q29 Q30

2.2
/16

Total /40

Page 1 of 6
 First Part (10 Marks): Answer the following questions:

1- Find the CPU execution time for a program with 8 × 109 instructions on a 2 GHz machine, where the Cycles
per instruction (CPI) is 2 cycles. (3 Marks)
Solution:
Instruction Count =8 × 109 instructions
Cycles per Instruction (CPI) = 2
Frequency = 2 GHz (2×109 Hz)

CPU execution time = Instruction Count × CPI / frequency


= 8 × 109 × 2 / (2×109)
= 8 sec

2- Write a MATLAB user defined function with name “Feh” to convert the temperature in degrees
Celsius (°C) to the temperature in degrees Fahrenheit (°F). (4 Marks)
𝟗
Note:(𝑭 = 𝑪 ∗ 𝟓 + 𝟑𝟐)
Answer:

function F=Feh(C)
F=C*9/5+32;
return

3- Using “for” command in MATLAB to write the even numbers from 20 to 30. (3Marks)
Answer:

for i=20:2:30
disp(i);
end

Page 2 of 6
 Second Part (30 Marks): Choose the correct answer for the following questions:
1- …………….. performs arithmetic and logic operations.
a) Registers b) ALU c) ROM d) CU e) RAM

2- …………… controls all other devices and controls the data flow between CPU and peripherals
a) Registers b) ALU c) CU d) ROM e) RAM

3- ………… stores information which is not subject to change.


a) Hard disk b) ALU c)ROM d) CU e) RAM

4- At the computer working, the operating system must be loaded into the…………….
a) Hard disk b) ALU c)ROM d) CU e) RAM

5- …………….protect from errors and monitor the system


a) CPU b) ALU c)Mathematica d) CU e) Operating Systems

6- The system …………………………………… is known as multi-programming system.


a) Single user - b) Single user - c) Multiuser and d) Multiprocessing e) None of the above
single tasking Multitasking single tasking

7- MMUs provide an additional memory to handle large program or a large number of programs. This
memory is called……………
a) Hard disk b) Virtual memory c)Main memory d) RAM e) None of the above

8- …………….is a set of rules (protocols) governing communications among all computers on the Internet.
a) FTP b) TCP/IP c) ISP d) HTML e) None of the above

9- If a coding system represents any symbol by 8 digits, this system can represent .................different
characters.
a) 82 b) 256 c) 128 d)26 e) 8

10- The word “HASAN” using EBCDIC code (8bits) and during the transmission has ………. bits.
a) 52 b) 85 c) 45 d)54 e) 101101

Page 3 of 6
11- For data analysis you can use………:
a) MS Word b) MS Access (a) c) MS Excel d) MS PowerPoint e) None of these

12- When you save a Word document as a webpage MS Word convert the Contents of the document
into………..:
a) UNIX b) JAVA c)HTML d) MATLAB e) None of the above

13- In which tab (menu), can you create a relationship between two tables in MS access?
a) Home b) Create c)Database Tools d) External Data e) Insert

14- To send individual email messages to multiple recipients you can use……….
a) MS Access b) MS Word c)MS Powerpoint d) Scientific e) MS Excel
Workplace

15- The equivalent binary value of the number (45)10 is:


a) 101111 b) 101101 c) 101011 d) 110101 e) None of the above

16- The equivalent decimal value of the number (A8F)16 is:


a) 2703 b) 2730 c) 10816 d)6384 e) None of the above

17- Which of the following commands is used to clear the contents of the figure window in MATLAB?
a) clf b) clear c) clearfigure d) return e) clc

18- Which of the following commands is used to clear the contents of the workspace window in MATLAB?
a) clear b) clc c) clf d) return e) whose

19- The result of the following expressions in MATLAB:


b=[-3, 2; 0 2] ; c=[3;2]; disp(b./c);
−1 1 −9 6 −1 d) Error e) None of the above
a) [ ] b) [ ] c)[ ]
0 1 0 4 1

20- The result of the following expressions in MATLAB:


a=[1, 0; 2, 1]; b=[-3, 2; 0 2] ; disp(b>=a);
−1 1 0 1 1 0 d) Error e) None of the above
a) [ ] b) [ ] c)[ ]
0 1 0 1 1 0

21- Which of the following is the correct command to plot a figure in MATLAB?
a) plot[x,y,’b-’] b) plot(x,y,’b-’) c) plot(x,y,”b-“) d) disp(x,y,’b-’) e) None of the above

Page 4 of 6
22- The result of the following MATLAB statements is:
i=5; while (i<=10)
i =i+ 2; disp(i); end
a) 5 b) 7 c) 5 d) Error e) None of the above
7 9 7
9 11 9
11

23- The result of the following MATLAB statements is………………………..


𝐦 = −𝟓; 𝐢 = −𝟓; 𝐧 = 𝐢/𝐦;
if (n < 0)
disp('Negative');
elseif (n=0)
disp('Zero'); else
disp('Positive'); end
a) Negative b) Zero c) Error d) Positive e) None of the above

24- The result of the following MATLAB statement is…………………..


for ii = 2:3:11
if ii == 8;
continue;
end
disp(ii);
end
a) 2 b) 2 c) 2 d) Error e) None of the above
5 5 5
8 8
11

25- The result of the implementation of the following Mathematica statement is: (1 Mark)
X={3,7,1,9,12,20,b}; Y={1,a,b,20,19,30,11}; Intersection[X, Y]
a) {3,19,1} b) {3,7,9,12} c) Error d) {1,19,20,b} e) {1,20,b}

26- The result of the following Mathematica statement is:


n=1; While[(n=(n^2+1)*2)<100,Print[n+5]]
a) 9 b) 169 c)7 d) n+5 e) None of the above
39 15 n+5

27- The result of the following Mathematica statement is:


For[i = 8, i >= 5, i /= 2, Print[i^2]]
a) 64 b) 64 c)46 d) 16 e) None of the above
16
Page 5 of 6
28- The result of the following Mathematica statement is:
sum=0; Do[sum+=i,{i,3}]; Print[sum];
a) 1 b) 1 c)6 d) 0 e) None of the above
3 3 1
6 4 2

29- The result of the following Mathematica statement is:


x=13; y=39; z=3;
If [ y<(x z), Print[Omar], Print[Ahmed] ,Print[Hussein]]
a) Omar b) Hussein c) Ahmed d) Nothing e) Error

30- The result of the following Mathematica statement is:


B={0,1,2,3,4,5,6};
Take[B,{2,4}]
a) {2,3,4} b) {2,4} c) {1,2,3} d) {0,1,3,5,6} e) {3,4,5}

Best Regards

Page 6 of 6

You might also like