Sunteți pe pagina 1din 9

University of Bahrain College of Information Technology Department of Computer Science Semester I, 2002-2003 ITCS101 (Introduction to Computer Science &

IT)

Final Exam FORM A


Date: 14/Jan/2003 Time : 08:30-10:30 AM

STUDENT NAME

STUDENT ID # SECTION #

NOTE: THERE ARE X (9) PAGES IN THIS TEST

QUESTION # 1 2 3 4 5 6 7 TOTAL

MARKS 22.5 12 18 6 11.5 10 20 100

COMMENTS

Page 1 PDF created with FinePrint pdfFactory trial version http://www.pdffactory.com

Question 1 (22.5 Points)


Circle one appropriate answer in each of the following: 1. The concept of using multiple processors in the same computer system is known as: (a) massive processing (b) acute processing (c) parallel processing (d) perpendicular processing 2. We describe the processor of a computer in terms of three characteristics, except: (a) Word Size (b) Physical size (c) Processor Speed (d) Memory Capacity 3. Which two buses enable the daisy chaining of peripheral devices: (a) USB and SCSI (b) SCSI and infrared (c) Infrared and PCI local bus (d) PCI local bus and ISA 4. PC components are linked via a common electrical: (a) train (b) bus (c) car (d) plane 5. The combination of bits used to represent a character is called a: (a) Field (b) Byte (c) File (d) Database

6. What can you do with the Internet? (a) Exchange information with friends and colleagues (b) Access pictures, sounds, video clips and other media elements (c) Find diverse perspective on issues from a global audience (d) Post and respond to inquiries on a variety of subjects (e) All of the above

7. What does the abbreviation http stand for? (a) Hypertext Transfer Protocol (b) High Task Termination Procedure (c) Harvard Teletext Proof (d) High Tec Transmission Policy

Page 2 PDF created with FinePrint pdfFactory trial version http://www.pdffactory.com

8. The Uniform Resource Locator (URL): (a) Is the standard protocol by which World Wide Web information is served (b) Is the standard coding language used to create Web pages (c) Is the name of a Web browser (d) Is the standard addressing system used to locate World Wide Web resources 9. Which of the following shows the correct form of an email address? (a) mohd@uob.edu.bh (b) mohd.edu@gopher (c) http:mohd.uob.edu (d) mohd@uob@edu 10. The opening page for a particular Web site normally is the: (a) opener page (b) home page (c) office page (d) master page 11. The presentation of the results of processing is called: (a) Play (b) Outcome (c) Output (d) Printout 12. Mail sent electronically is called: (a) snail mail (b) e-mail (c) super mail (d) quick mail 13. A scanner is an example of which of the four computer system components: (a) input (b) output (c) processor (d) storage 14. Which component of a computer system executes the program: (a) input (b) output (c) processor (d) storage 15. The name of the applications that combine text, sound, graphics, motion video, and/or animation is: (a) videoscapes (b) motionware (c) multimedia (d) dvd Page 3 PDF created with FinePrint pdfFactory trial version http://www.pdffactory.com

Question 2 (12 Points)


Show the output of the following C program in the Output Box below. #include<stdio.h> int G=20; void MyFunc(int,int); void main() { int Num1= 8, Num2=2, Num3= 6, Num4= 5; printf("CALL #"); MyFunc(Num1,Num2); printf("%4d%4d%4d%4d\n",Num1,Num2,Num3,G); printf("CALL #"); MyFunc(Num4,7); printf("%4d%4d%4d%4d\n",Num4,Num3, Num1/3, G); } void MyFunc(int X,int Y) { static int SN=1; int Num3=4; X-=3; Y++; G = G * 2; printf("%d\n%4d%4d%4d%4d\n", SN, Num3, X, Y, G); ++SN; } Output

Page 4 PDF created with FinePrint pdfFactory trial version http://www.pdffactory.com

Question 3 (18 Points)


Given the following two-dimensional array X, 1 5 1 4 2 6 2 5 3 0 4 6 4 0 5 0

(a) Write the declaration needed to define and initialize the array X.

(b) Show the output of the following C program segment in the Output Box below assuming that the array X is as defined above. Use the values given above for X to produce your output. for (int row=0; row<4; row++) { for (int col=0; col<4; col++) { if (row == col) continue; if ((X[row][col] % 3) == 0) break; printf("%4d%4d%4d\n",row,col, X[row][col]); } } Output

Page 5 PDF created with FinePrint pdfFactory trial version http://www.pdffactory.com

Question 4 (6 Points)
. Convert the following while loop into an equivalent do-while loop. int count=0, num; scanf("%d",&num); while (num != -1) { count++; scanf("%d",&num); } printf("count=%d\n",count);

Page 6 PDF created with FinePrint pdfFactory trial version http://www.pdffactory.com

Question 5 (11.5 Points)


Write a function named DisplayDiagonally that accepts an array of characters and its size. The function should print the characters in a diagonal shape as shown below. Example: If the array contains BAHRAIN then the output should be: B A H R A I N

Page 7 PDF created with FinePrint pdfFactory trial version http://www.pdffactory.com

Question 6 (10 Points)


Write a complete C program that generates a random number between 0 and 4 inclusive. The program should print a letter according to the table below. NOTE: the only selection statement you may use is the switch statement. Random number 0 1 2 3 4 letter A A E N M

Page 8 PDF created with FinePrint pdfFactory trial version http://www.pdffactory.com

Question 7 (20 Points)


Write a complete C program that asks the user to input two sets of integer numbers each of size 5 and store them in two arrays A and B. The program then outputs the elements that are common to both sets (available in both A and B). If there are no common elements, the program should output the message "No common elements ". An example of the program RUN: Enter the values of A[0] and B[0] >2 Enter the values of A[1] and B[1] >1 Enter the values of A[2] and B[2] >5 Enter the values of A[3] and B[3] >7 Enter the values of A[4] and B[4] >6 The result is: 2 5 6 4 6 2 5 3

Page 9 PDF created with FinePrint pdfFactory trial version http://www.pdffactory.com

S-ar putea să vă placă și