You are on page 1of 23
fe oe. rest cove 02115020 | FORM TP 2016175 MAY/JUNE 2016 CARIBBEAN EXAMINATIONS COUNCIL ‘e CARIBBEAN ADVANCED PROFICIENCY EXAMINATION® COMPUTER SCIENCE FUNDAMENTALS OF COMPUTER SCIENCE UNIT 1—Paper 02 2 hours 30 minutes 7 READ THE FOLLOWING INSTRUCTIONS CAREFULLY. 1. This paper consists of SIX questions. Answer ALL questions. |.2. Write your answers in the spaces provided in this booklet. 3. Do NOT write in the margins. 4. Ifyou need to rewrite any answer and there is not enough space to do so on the original page, you must use the extra lined page(s) provided at the back of this booklet. Remember to draw a line through your original answer. 5. Ifyou use the extra page(s) you MUST write the question number clearly in the box provided at the top of the extra page(s) and, where relevant, include the question part beside the answer. DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO. Copyright © 2015 Caribbean Examinations Coun Allrights reserved. SECTION A COMPUTER ARCHITECTURE AND ORGANIZATION Answer BOTH questions. 1. @ _ The logic circuit in Figure | refers to a system of three switches, A, B and C. The combination of switches illustrated below determines whether a bell, X, sounds. A B Figure 1 In the space below, construct the truth table for the circuit in Figure | [4 marks} GO ON TO THE NEXT PAGE 02115020/CAPE 2016 i aaa LIN THUS AREA: ThA WAR Wari IN FAINARBA (CR e bE 5 a =| (b) Inthe space below, construct a truth table for the proposition PA Q. [4 marks] (©) What is a program counter? GO ON TO THE NEXT PAGE 02115020/CAPE 2016 i {00100 A AT ' i “] (d) Below are two 8-bit binary numbers which are stored in Registers J and 2 respectively. When the numbers are added, the result is stored in an 8-bit register, Register 3. ‘Add the two numbers and explain what will be stored in Regisier 3. Show ALL working. Register 1 = 10010111 Register 2 = 11011000 Register 3 = [4 marks} (©) Convert the decimal number 13.25 to binary. Show ALL working. {3 marks} GO ON TO THE NEXT PAGE 02115020/CAPE 2016 NN ET 1 r * 1 (What is a ‘multiplexor’. In the space provided below, draw a block diagram to support your answer. PERMA TCE RRNA itor RUN Mace aVEa® [4 marks} (2) Why is multiplexing important? Provide @ scenario to support your answer. | [4 marks} Total 25 marks GO ON TO THE NEXT PAGE 02115020/CAPE 2016 ! (OE AT 1 r * 7 (@ Figure 2 shows the basic hierarchy of computer memory. It requires four examples of specific types of memory for completeness. 4 Memory 3 4 E z Primary Secondary = = a : Non-Volatile Volatile 3 4 s 1 2 Figure 2 Provide ONE example for EACH of the missing entries labelled 1, 2, 3 and 4. GO ON TO THE NEXT PAGE 02115020/CAPE 2016 ‘ROCA 00 1 7: 7 () Imagine that electricity is available but is not consistently supplied in your community. You have just purchased a cellphone which gives 10 hours of battery power and takes 5 to T hours to become fully charged ~ if not in constant use. Clearly explain the purpose and core benefit that EACH of the following devices will yield in this scenario. @_ Surge protector AUER eRe nto eererge Gi) Voltage regulator : a Fy EI a (iil) UPS g = # = 3 g 5 = (©) Define the term ‘clock speed’ as it relates to a processor. Give TWO examples of CPU clock speeds using different units of measure. x a = 5 = : FE Ee ‘ eee 3 [3 marks} GO ON TO THE NEXT PAGE 02115020/CAPE 2016 1 {INN ML 1 r “e: 1 (d) Describe ONE input device and ONE output device that could be used by a person who is visually impaired. [4 marks] (©) Explain the main difference between a supercomputer and a mainframe computer. Provide TWO examples of how EACH type of computer is used. [S marks] GO ON TO THE NEXT PAGE 02115020/CAPE 2016 1 {AO ET RE 1 i a (© There are several types of instructions which can be performed by the processor. Write a set of instructions to perform a mathematical calculation. Include THREE different instructions in your answer. i i 3 i 2 i [3 marks] Total 25 marks AME eraoneuerscy a auranera gn gia: ACN Re Ea ae Ren ag GO ON TO THE NEXT PAGE 0211S020/CAPE 2016 1 ‘OVS ERT 1 . - 1 SECTION B L PROBLEM SOLVING WITH COMPUTERS Answer BOTH ques ions. (@) Ata fibraty, a set of data representing outstanding customer balances exist. Each line consists of a customer’s id (integer), followed by the number of books outstanding (integer) and the rate at which fines are charged (character). If the fines rate is P, the customer pays $4.50 for each overdue book. Ifthe fines rate is N, the customer pays $6.50 for each overdue book. The last line contains 9999 only. Assume all data are vali Sample Data: 2000 5 P S 1534 6 ON : Zi 10 P = 9999 Ee In the space provided on page 13, write an algorithm to read the data and determine the EE following: i x + The total outstanding fines for each customer z + The total amount of fines paid under each of the categories, N and P a4 + The total amount of fines paid overall a + The number of customers Ee + The customer id for the highest fine paid (ignore ties) i AN E 4 3 = ‘ & & < 8 & s z s £ GO ON TO THE NEXT PAGE 02115020/CAPE 2016 A DO NGT WTE IN THIS Ap HS AREA DONO IRIE IN TH DO NOT RITE IN THUS REN 02115020/CAPE 2016 OO [1S marks} GO ON TO THE NEXT PAGE : ve 1 (6) Distinguish between ‘bounded iteration’ and ‘unbounded iteration’. [4 marks] (©) Write an algorithm to find the sum of all multiples of 7 between 21 and 210 (inclusive), 6 marks] Total 25 marks GO ON TO THE NEXT PAGE 02115020/CAPE 2016 : oc se eK e : E : z : LS = : ES : i CBAINATWWa Tne INRHIR ARIA 4 3 i 5 iS TIRANA Dr a “ 1 4. (@)__Inthe space provided on page 17, construct a flowchart to represent the following algorithm. read name ed if name = ‘enddata’ 2 print ‘No data supplied.’ else : while name <> ‘enddata’ read amt read quan sale = amt * quan print This sale = ‘, sale read name endwhile endif TT GO ON TO THE NEXT PAGE 02115020/CAPE 2016 E [- -17- | PO NOT WRITE IN THISAREA 0) [11 marks} SDONOT RITE IN THIS HREM GO ON TO THE NEXT PAGE 02115020/CAPE 2016 . ra eae r a |) (6) A.communications company provides the following rates for telephone calls. Write an algorithm that reads an integer value representing the amount of minutes for a call and calculates and prints the cost of the call. [6 marks] GO ON TO THE NEXT PAGE 0211S020/CAPE 2016 i TEIN THIS AREA | | DONOTIERG AREA DO NOT WRITE IN THIS a é os Q < 5 : = s 2 v. 1 (©) Acompany called ExcelCo sells used video games and wishes to acquire software to track purchases, customer information and the quantities of video games in stock. The company has contracted the services of a software company called SoftwarePlus that writes software applications. Briefly describe any FOUR stages that SoftwarePlus would generally follow when creating the software for ExeelCo. “Tg marks} ‘Total 25 marks GO ON TO THE NEXT PAGE 02115020/CAPE 2016 are 5 _ * 7 SECTION C PROGRAMMING : Answer BOTH questions. (@ certain computer program simulates simple guessing game. First the program generates arandom number between 1 and 10 (inclusive), then the user tries to guess this number by entering an integer. The user continues to enter integers until the number generated and the number guessed are the same. When the numbers are the same the program notifies the user and prints a count of the numbers the user guessed before correctly guessing the random number. In the space provided on page 21, write a C program which will simulate this guessing game. The following line of code will generate a random number between I and 10 (inclusive). You may use the following line of code in your program. int r= rand() $10 +1; // random number generator GO ON TO THE NEXT PAGE 02115020/CAPE 2016 [12 marks} GO ON TO THE NEXT PAGE -21- 02115020/CAPE 2016 WORD SHALL NT AED LON OG a = 7 (b) This question is related to various programming paradigms. (What is a procedural language? (ii) What is an object oriented language? [2 marks} (©) Youhave been commissioned to assist with the development of an application to keep track of district details for an upcoming general election. The data file, constitwency.txt, stores the following district details — ID, name, population count and the number of eligible voters. The format for this file is shown in Figure 3 below. Data is terminated by a line an ; containing the characters XX only. Al Kingstown 5000-3500 A2 —Portof Spain 9000 7245 AB Castries 6000 4000 Bl StCatherine 3500-2000 cs StJoseph 2200-1500 XX Figure 3 In the space provided on page 23, write C code which will + read in data from the file + count the total number of districts recorded + find the district with the highest number of eligible voters. GO ON TO THE NEXT PAGE 02115020/CAPE 2016 | 2 af A ES 2. ~7] He [10 marks} Total 25 marks GO ON TO THE NEXT PAGE, 02115020/CAPE 2016 rc 6. @ (b) = 24- 7] z State THREE ways in which an application for a mobile device may differ from an application for a desktop computer. BS marks} What output is produced by the following C code? Hinclude int test (int b, int c, int a) ( return (c + a); } int main () { inta=1, b=2, c= 3, while (a <= 10). { for (b= c7 b <= 7; b= b+ 2) ( a= test(a, b, c)s printf("a is 8d b is 8d¢ is 8d\n",a, by c); attr ons } //f0r azat2; 1//while return 07 //main [10 marks} GO ON-TO THE NEXT PAGE 02115020/CAPE 2016 rc ©) @ Gi “aon Gi) -25- 7 Declare in C a structure called BookRec that can store data for a book. A book’s data consists of id (integer), quantity in stock (integer) and price (double). [3 marks] Write C code to load data into EACH of two books, book! and book2. Note: book! and book2 are of type BookRec. Obtain the data from the user. Write C code to increase the price of book! by 25%. GO ON TO THE NEXT PAGE 02115020/CAPE 2016 FE as 7 (iv) Write C code to interchange the contents of book! and book2. [3 marks] Total 25 marks 4 END OF TEST IF YOU FINISH BEFORE TIME IS CALLED, CHECK YOUR WORK ON THIS TEST. 02115020/CAPE 2016 ae aaa

You might also like