You are on page 1of 4
1 @ o SECTION A. DATA STRUCTURES: Answer BOTH questions. ‘The Stack Abstract Data Type (ADT) provides a pop (Stack) operation, a push (Stack, data) operation, and an isEmpy (Stack) operation. (Suppose that you need to implement a Stack for storing integers. Describe how ‘you will implement the THREE stack operations above using static computer storage [4 marks] i) Write the C code fora function that implements the pus (Stack, data) operation assuming that datas an integer value. Your fumetion must deal wit sack overflow ‘conaitions. 15 marks} ‘Consider the following algorithm where expr is a sting containing a postix expression ‘Gat i, an expression containing "1", ", and "characters ax well an digit) and the number of characters in expr char oh it digit, xy if Gsdigit (Ch) begin //sDigitretums tru ifch isa digit digit= value (ch) 1 value returns the integer value of ch push (stk, digit) Ii stk isthe name of the stack cise ie(en else if (ch clse newal =x/y push (et, now) end end x= pop (th) print ("The value of expr is" +x) Assume that sti initially empty. Determine the output of the above algorithm if mis 9 land expr is 923°-82/+. Draw the stack on EACH iteration ofthe for loop [10 marks) GO ON TO THE NEXT PAGE (02215020/CAPE 2009 © @ ) A string is palindrome if spells the same way forwards and backwards (for example, “madann”), Explain how a stack can be used to determine i string isa palindrome, @ «, o « (02215020/CAPE 2009 [6 marks} ‘Total 25 marks Write a funetion, earch, which accepts the following parameters array of ings, nthe amount of elements in arr, and ‘ey, the integer being searched for snd performs a Tinea search on ar for key. I ey is found, your function should return the location in the array arr, where it was found. Otherwise, it should retum =I [10 marks} ‘Assume that key isnot present in are. How many elemens in ar wil be checked before is retumed? [i mark ‘A funetion is required that accepts the same parameters and retuns the same values asstated in (a) (1) above. The function however, perfurms de binary searel omar. Using an algorithm or otherwise, describe the steps that will be performed during the binary search of wr, [10 marks} Aseume tha arr contains the flowing alemonts (in the order given) and kay i 40: 7 10 15 17 18 25 5 37 40-45 50 S5 56.57 58.6 63 71 75 78 81 How many elements of arr willbe checked before the correct location is retumed? ‘Show your working. [4 marks) ‘Total 25 marks GO ON TO THE NEXT PAGE ) © © © SECTION B SOFTWARE ENGINEERING Answer BOTH questions. (Briefly explain what is involved inthe evolutionary development of software [3 marks) Gi) State TWO penbleme of sing the evaitionary development appranch [2 marks} Ina typical visit toa doctor, when the doctor consults with the patient, the patient tells the ‘doctor the symptoms of hisher problem. the doctor uses nisner medical knowledge and ‘experience together with any historical information available onthe patent (from patient file) and makes a diagnosis. This diagnosis is reported to the patient and recorded inthe patient file, Based on the diagnosis, the dior presctibes a vous uf medication fr the ‘tint. In order to bill the patient, the doctor submis thelist of tests and services performed to the accounting section. The prices forthe tests and services are obtained from an accounting fle and the cost of ch visi caloulated and revorded inthe file. bill then given to the patient, Draw a Level0 dataflow diagram forthe above scenario, [14 marks} (Describe TWO ways in which a CASE tool can be used ina software development process. [4 marks} (WH) State UNE savantage and UNE: aiseavantage of using a CASE tool, [2 marks] ‘otal 25 marks (What are functional requirements? [2 marks} ii) Discuss how functional requirements are obtained during analysis ofa software system. [Smarks} ‘A certain private hospital has a number of wards. Several doctors are hired by the hospital to treat patients wh sore medical eeviens A patent may he a hy ane at more doctors ‘buts asigned to one ward. When a patient is assigned to a ward, he patient i prescribed ‘one or more drugs fora certain period. The patient's firstname, lastname, and addres are recorded and a patent id is used to uniquely identify each patient at the hospital Draw an entty-relationship model forthe above scenario. [14 marks} ‘A.one-dimensional aray num consists of 20 integers. The integers are NOT sorted, ‘Consider C programming code that is written to accept at-ineger, target, from the user and determines ifargetis present in mum. If target's found in num, the location in which it was found is printed. If anger isnot present in mum, an appropriate error message is printed Briefly describe THREE tests which can be used to determine ifthe eode is working correctly. [6 marks} ‘Total 25 marks GO ON TO THE NEXT PAGE (02218020/CAPE 2009 @ © © @ © OO) © @ © SECTION C OPERATING SYSTEMS AND COMPUTER NETWORKS Answer BOTH questions. Briefly explain how EACH ofthe following features can ad in network management (User accounts i) Access logs [ 6 marks} (State the frst FOUR layers (that is, layers to 4) ofthe OST model for computer ‘communication, {2 marks} Gi) Explain how EACH of the layers stated in S(b)i) above are involved in the tranemiesion of a lange fl, 1 8 marks} Explain how data are communicated in an IEEES02.11b network? Use a diagram in your response, {7 marks} Distinguish between the CDMA and TDMA access methods for mobile networks. [2 marks) ‘Total 25 marks ‘escriethe fimetion af a device driver, 1.3 marks} ‘What isa hybrid network? | 2 marks} A users working ona document ina word processor and then selects the “Print” option of the word processor. The document then begins to spool (Explain whet happens daring spooling, [mares] id) Discuss ONE advantage of spooling. [ 2 marks) (Give ONE reason why a menu interface may be prefered over command interface. 1 2 marks) Gi) GiveONEsenen wy a conmuand terface may be preferred overe mons intra. [2 marks} Deseribe TWO possible interrupts that ean oocur while a user is running a game an 2 ‘computer | 6 marks} Ausers running an application that requires more RAM (Random Access Memory) than that which is physically installed in the computer. Briefly discuss how the concept of paging can be used to solve the memory problem experienced by the user. § marks} “Total 25 maths END OF TEST (02215020/CAPE 2009

You might also like