Download as pdf
Download as pdf
You are on page 1of 18
f UNIVERSITY OF CAL}.BAR, CALABAR DEPARTMENT OF COMPUTER SCIENCE le SECOND SEMESTER EXAMINATION 2018/2019 SESSION COURSE CODE: CSC 242 cours Jf: FUNDAMENTALS OF DATA STRUCTURES ‘TIME: 24HRS INSTRUCTION: ANSWER FOUR QUESTIONS IN ALL. Hrustations ani sketches cttract marks. Make your answers brief. 1. s. What is a Type? What is an Abstract Data type? b. "Rarely is one data steuctuie better than another in all situations" Justify your answer using an array or n binary search tree for a text search problem. What is an ARRAY? What is a binary search tree? a, What is a List Data Structure? With illustrations, discuss the principles of insertion and deletion of a list item in a linked list. b, Every programming problem hag some constraints on available space and time. What is the role of data structuring in this case? Discuss the Stack Data Structures. Build a complete binary tree labelled A to N and traverse it” in-order, pre-order, and post-order a. What is a Queue? Explain Enqueue( ) and Dequeuet ). ©. A Heap can be implemented using a simple linked list or using a binary search tree. Explain, the pit falls in these methods. c. What is a binary Heap? What advantage has List over Arrays? Discuss the concept of encapsulation hence differentiate between attributes and methods What is recursion?, Give the characteristics of recursive functions hence write a recursive algorithmn to return the factorial of a number Briefly discuss the recursive solution to the Tower of Hanoi problem Aa) by ° 5a) ‘What do you understand by the efficiency of an algorithm? Distinguish between runtime and space complexity of an algorithm. . b)i) Mention the factors that can affect the execution time of an algorithm. Given the algorithm below, determine its runtime complexity. Express your answer in Big O notation. set sum (0 for (770; I<; PE Sor Gal; fom; FYE sum — sum + xfi1Ui] , i print sum ¢) Briefly discuss information hiding with examples. Given two algorithms A and B, with linear and constant runtime complexities, discuss how Ga} an increase in the problem size will affect the Tunning time of each algorithm. 7 b) Write a recursive algorithm that computes the sum of the elements of an array. Determine the runtime complexity of your algorithm : ) What is the purpose of Big O notation? Discuss the best, average and worst case efficiency search algorithm. Scanned wth Camscaner OF Rong OJF0 2 shaky Simeon DEPARTMENT OF COMPUTER SCIENCE ly SECOND SEMESTER EXAMINATION 2018/2019 ACADEMIC SESSION , Cc ~ ROUNDATIONS OF L PROGRAM ROM EACH SECTION 15/11/2019 rons SIMEON CFFIONG 8) Give a general description of machine language based on only threo main hardware elements and briefly oxplain these hardware elements, b) A program is running on a specific computer with, the following parameters: (a) Total executed instruction count = 30,000,000 instructions, (b) Average CPI for the program = 5.25 and (c) CPU clock rato = 300MIHz, What is the execution time for this program? ) A control unit has set of input values on the basis of which it produces an output control signal which in turn performs micro-operation. Briefly explain the input sources of the control unit, j <17.5 MARKS> ! INSTRUCTION: ANSWER ANY TWO QL PIME: 2 HOURS ) Perform the following mathematical operations: (i) 100012 ~ 1002 (ii) 110142 * 1012 + (ji) DEED3s- 89610 (iv) SDA *ABys. <7.5Marks> ~ 2b) Compute the 8-bit two's complement binary encodings of 75, 75=--75. c) (i) What are the basic features of RISC and CISC processors. (ii) Technically differeritiate Dynamic RAM (ORAM) from Static RAM (SRAM). ’ <17.5 MARKS> 75, and - - 75 to convince yourself that For a programming language to be worthy of its name, it must satisfy certain requirements. Discuss. termine the value of Y in the following mathematical equations: (i) 3456s = Y2_° ° (ii) Yie=5762 (iii) Yo = 2345. (iv) 19FDEis = Yoo Le 7b ‘, t ©} (i) Clearly categorize micro-operations performed by the CPU. (i) In a tabular form, cleatly depicts the relationship among hexadecimal, decimal, octal and binary number systems. i b) SECTION B 4(a) Discuss briefly the concept of addressing mode. | 4(b) List the area of application of the following addressing mode: Immediate Addressing Mode, Direct Addressing Mocle, Register Direct Addressing Mode, Indirect Addressing Mode, Register. Indirect Addressing Mode, Relative Addressing Mode, Index Addressing Mode, Base Register Addressing Mode, Auto-increment Addressing Mode and Auto-decrement Addressing Mode 4(c) Draw a diagram to show the phases of compilation $17.5 MARKS> 5(a) Differentiate between Harvard Architecture and Modified Harvard Architecture, State the machine (processor that has modified Harvard Architecture implementation. 5(b) Explain the concept of Von Neumann Bottleneck. 5(c) What is a compiler? List and discuss the phases of compilation. <17.5 MARKS> (a) Discuss the following addressing modes with specific examples: (|) immediate addressing, (ii) register addressing, (ii) direct addressing (iv) register direct addressing (v) based addressing mode. ©(b) Discuss the compiler in terms of the following: (i) front end and back end (ii) Analysis and Synthesis phases. S{c) To write programs in Assembly language, the programmer requirés six (6) basic Assembly language development tools. List and discuss these six (6) tools, $17.5 MARKS> z ek has dade 2 ey Reis { Shng 4 Knee alm iticlees ot few cela Keg SKID IDK an - minal 'S the Gittleaese = Bosse lss (cr 3000 . i . Scanned wth Camscaner | MTON CEP, JONG UNIVERSITY OF CALABAR DEPARTMENT OF PHYSICS SECOND SEMESTER EXAM 2018/2019 SESSION PHY 262 ~ ELECTRIC CIRCUITS & ELECTRONICS Instruction: SECTION A 1 (a) State the Kirchhof's Laws. (Amarks) (b) Find the values of and lsin the circuit of Fig. 1 if k= 5A, 1. LA, (6.Smarks) (marks) Va SUgkte don 2. (a) What is the sifertoce between ideal current source and practical current source. (amarks) (0) State (i) Norton's theorem (i) Thevenin’s theorem. (6marks) {c) Using Thevenin’s theorem, find thé load curent kin the cicut of Fig (7-Smarks)- 2 SECTION 8 ‘wer four (4) questions; one (1) from each section. Time: 2hrs,30mins (01Using mesh curent method, ind he ower dspatedin the 6 restor of he crest of Pn a = 15Aand 3. (0) (i) Distinguish between unidirectional and alternating waveforms. (i) An alternating current completes cycles in ams. What isits frequency? (5.Smarks) (b) Define the Following alternating quantities; (i) Instantaneous value (i) Peak value (ll) Peak to Peak value (}) Root ‘mean square (r.m.s) value, (6marks), (c) An alternating voltage is given by V = 282.8sin34t volts, Find (i) the rms voltage. (ii) the frequency. (li) the instantaneous value of voltage when t = 4ms, (marks) 4. (a) A capacitor C of LF is used in a radio circuit when the frequency is 1000Hz and the current flowing Is 2mA (r.m.}. (i) Calculate the voltage across C, (il) What current flows when an a.¢, voltage of 20V;a,, f = SOHz is connected to this capacitor, (5.5marks) ‘Scanned with CansScanner the current taken {b) A resistor of 2508 connected in series witha capacitor of ASuF, calculate) shes impedance, (i) the current {3 {com 240, SOHz supply, (i). find the phase ansle ‘Acoll of resistance Sand inductance 220m in series with 2 100 te) cateulate; (ithe current flowing inte circuit (i) the voltage across the colli) he ywsunanve freques SECTI 4 Ke chat ey, J the current, (Omarks) 200v, 50He supply, between the supply voltage at WF capaciten is eannime tied 10 cy. (Gmarks). 5: a) ferentiae between intrinsic andextrnsle semiconductors (5.Smorks) = the (b) what is) Mobile charge carver (i) Immobile ions? (6marks) s {c) what are the three things that accur atthe junction of a PN Junction diode? (Genrks) 6. (a) Illustrate how transistor can be operated int) Saturation mode (i) Off mode (i) Meth (0) (i What transistor biasing? (i) Draw a well biased PNP or NPN transistor. (Gmarks)- (oshow that p = sfoanda = 5 (5.smart) SECTIOND, ae 7. (a) The diagram below shows the negative voltage feedback amplifier. Ifthe gain of the amplifier without feedback is 10,000, Find: (i) feedback fraction (i) Overall voltage gain (i) output voltage if input is mV. (6marks) ly ube Mvet Zureend {b) (i) State two (2) Barkhausen criteria for oscilator circuit to work. (2marks) {ii Differentiate between a positive and negative feedback (2marks) c {up The gain and distortion of an ampifier ae 150 : 2 tae and 5% cespectvely without feedback the stage has 10% of es out Voltage applied as negative feedback find the dstoton of the amplifr wih feedback, (Sma) (c) Define the following: (i) Amplifier (i) Filter (ili) Feedback (iv) Oseilator (Srtarks) 8, (a) Find the output D.C. pal from the below circuit? (Smarks) Given: py 145: VV = areal on x A», ‘= 113 Vw ctr Rye 22ke (1 (0 what isa turned Amplifier? (i) State two i) State two types of turned amplifier circuit? (li) list thee conditions that eee plifier circuit? (il) lst tee conedtions that may be used to, (6) considering the Barkhausen criteri Enterion, what are the effect of magnitule « waicimiansion men pent of magnitude of [AN] oh the nature of oscillators, wher “) ‘Scanned with CansScanner SIMFOM OfFioné DEPARTMENT OF STATISTICS VL rb / SECOND SEMESTER EXAMINATION 2018/2019 & TITLE: STATISTICAL INFERENCE Ul (STA 222/282) TIME: 2 HOURS UCTION: ANSWER ANY THREE QUESTION ‘the following torms (I) Point estiniate (i) Interval estimate (ii) Reliability ‘wo from a population ¥ and the following values: 20, 24, 28, 32, 26. f 0, is maximum of for the mean A, of samples of Inplacement, explain why 0, Is an unblasad estimator of Y and show that J, is a biased ‘0 samples each gotectod withor Mor of Y tically independent estimates of a population mean ys and 6, and d; are defined such that V [0,] = 2 ¥ (04). $5: Gil) 2 8, +25; (iv) 218 Himnators are obtained by linearly combining d, and 6,. The four estimators are () 6, (i) £3, Rank these estimators in decreasing order of efficiency. “te random variable X be a gamma disibuion wih parameter a and pl gen as (2) = SEE 2 > 9 hat @ EDI = (We ribution given by fhu!0] = e-*,0 > 0,2 > 0,h (x) = 1. Obtain () h{9/2] (i) Baye's estimation a random variable X has a di {for 6 if the loss function is quadratic. et ho independent random samples, of sizes n, = 16 and nz = 10 taken from two normal populations N (is,02) and N (42, 02) cspectvly yi = 3.6, $8 = 4.14.3) = 136 and Sf = 7.26 Fld a 95% confidence intel ort istinguish between the following pairs () Simple and composite hypothesis (i) One tailed and two-tailed test (ii) Type | and type \\ercors (iv) Critical value and ertical region Luicaking strengihs of cables produced! by a manufacturer have mean 815kg and standard devialioh 45kg, by a new technique n= manufacturing process, its claimed that the breaking strength can be increased, To test this claim, a sample of 0 cables is ‘sted and itis found that the mean breaking strength is 640kg. can we support the claim at a 0.01 level of significance: ‘ourteen housewives in Calabar were asked {o taste each of two types of bread made in Calabar and to decide their preference. ‘housewives preferred one bread, eight preferred the other kind, and two had no preference. Does this indicate a significant ‘itference in preference. . Stale and proof Neyman-Pearson Lemma X, be-a random sample from the distribution f(x; 0) = @¥(1 — 9)!~¥, Use the Neyman-Pearson-Lemma to find the 21K 2, Kaen o versus Hy: = Oy. ‘most powertul critical region of size a in the test of the hypothesis Mg Define the following terms () Uniformly most powerful test (i)Best critical region (ji) Power function (jv) Likelihood ratio test Find the efitical region ofthe likelihood ratio test for testing the null hypothesis Hy: = 4 against the composite allemative Hy: u # 's 0" the basis of a random sample of simple of size n form a normal population with known variance o?, (i) Wuhat is Analysis of Variance? (i) Discuss the various model assumptions that must be taken into consideration before testing hypothesis in ANOVA. {ot X,X2,., Xa denote a random sample from a normal distribution N (0, 100) show that C{@1, Xew..Xa)} @ < is a best critical ‘ei for teting € Ho, 0) = 75 against Ih: 0, = 78, find a and d such that c Pf (OXs.X2,..Xa)e C1) = 0.05 and. Pr(Ks, XaKs) «CiH1) = 0.60 approximately, (0 Le, %o. Xo, Xa, be independent and icenticaly distributed (i) random variable with mean @ and variance a®, Obtain the value ot which p = “8% is an unbiased estimator of 6. (il) Let Xs, Xa, Xs, Xa, Xs be independent and identically distributed dom variable with mean @ and variance 2, Define as estimators of 0 tatane, setts 7, tn, 7, 2 statin Show the Ts, Ta and Ts are unbiased and Ts bse di) Obtain the mos ecient of Ty, Ts and Ta ; ‘Scanned with CansScanner DEPARTMENT OF STATISTICS SECOND SEMESTER EXAMINATION 2018/2019 TIME: 2 HOURS COURSE TITLE: STATISTICAL INFERENCE II (STA 222/282) INSTRUCTION: ANSWER ANY THREE QUESTION 1a, Define the following terms (i) Point estimate (i) Interval estimate (il) Reliability b, List out the basic properties of an estimator 20, 24, 28, 32, 36. f G2 is maximum | and the following values: 20, 24, 28, 32, 2 ; (c) Consider the mean 0, of samples of size two from a population Y and , “ pane oe to samples each selected without replacement, explain why 0, isan unbiased estimator of Y and show that 8 is estimator of Y. 4. f 6, and 6; are statistically independent estimates of a population mean 4 and d, and 6, are defined such that V (9,] ia 6; ci) Four estimators are obtained by linearly combining d, and J. The four estimators:are (i) 8 (i) = + 0,]. Rank these estimators in decreasing order of efficiency. . 2a. Let the random variable X be a gamma distribution with parameter a and pdf given as f(x) Show that (I EX] == (ia = £ ». A given random variable X has a distribution given by f[x/6] = de®, > 0,x > 0, i (x) =f. Oblain () h6/3] (i) Baye's estimatior for ifthe loss function is quadratic, ©. Let two Independent random samples of sizes n = 16 and nz = 10 taken from two normal populations N (us,02) and N (jp, 02) 6,5} = 4.14.3, = 13.6 and 5? = 7.26, Find a 95% confidence Interval for respectively yield 2, = 2a. Distinguish betvieen the following pairs () Simple and composite hypothesis (i) One tailed and two-tailed test (ii Type | and type Werrors(v) Critical value and citical region ®. The breaking strengins of cables produced by a manufacturer have mean 816kg and standard deviation 45kg. by a new technique in the manufacturing process, itis claimed that the breaking strength can be increased. To test this claim, a sample of 50 cables is tested and itis f-und that the mean breaking strep it 840kg. ean we support the claim at a 0.04 level of significanco. 6. Fourteen housewives in Calabar wee asked to taste each of vo types of bread made in Calabar and to decide thr proference, Four housewives preferred oné biead, eight preferred the other kind, and two had no preference. Does this indienle ¢ significant aiference in preference 4a, State and proof Neyman-Pearson Lemma ® Let Xr, Xa Xavi X, be a random sample from tho distribution (6) = 0*(1 ~ 6}, Use the Neyman-Pearson-Lefama to find he most powerful esical region of size a in the test of the hypothesis Hy: = Gp versus ths 0 = 0. Best erlical rein (ii) Power funciton (hu) Likoihaod rallu test ». Find the critical region of the likelihood ratio test for testing the null hypothesis Ht, a(n the basis of a random sample of simple of size n form a normal population ¢. Define the following torms (i) Uniformly most powerfu! ter: = ig against the composite altemative with known variance o?. a. (I) What is Analysis of Varian s my i ve wae af of Variance? (i) Discuss the various model assumptions that must be taken into consideration before testing Let Xi, Xs... Xn denote a random sample from a normal distribution N (0, 100) Ci < it m + 100) show that C((X1, X2,..Xn)) @ S £ Is a bost critical £690" for testing ¢ Ho, : &y = 75 against Hs: 6, = 78, find a and d such that ¢ P OO Yas Prf(X', Xa.-.Xn) ce tng Ha y= 75m 'at © PE (X:,Xa,...X-) € €; Hg) = 0.05 and Pr{(Xs, Xa... © @) Let Xs, X2, Xs, Xe, be independent and identically distributed (i) random variable wit fe for whlch p= SSE22 san unbiased estimator of 8.) Lel Xi Xo Xe oy ‘endom variable with mean @ and variance a2, Define as estimators of 6. pera eeenecderd an eee ante = SRE, Ty Bt pL nude 7 nttstin (9 Show the Th, Tz, and Ts aro unbiased and Ta biage (i) Obtain the most efficient of T, Ta and Ts. Scanned wth Camscaner UNIVERSITY OF CALABAR DEPARTMENT OF STATISTICS COURSE TITLE: STA 222/282 STATISTICAL INFERENCE Il ‘Type II error in hypothesis testing +a) Define the following terms (i) Type | ero (i lecision and consequsances in taking certain decisions sch decisions. iy The table below shows aresearcher's ds sin a hypothesis testing, ‘Complete the tabls in terms of probability of consequences In Siu TAccepianee 1 [Rejection eee | ee acerca region ty vile (ii) Cri ) Write short aotes on the following (i) Test of hspothess (i) The probabil Jey Let X be a random variable with the probability density function Iis.0) = O0°%,x°> 0. Lpetermine the best critical region for testing Ho: @ = Op against Hi: @ = Oy 4) Li vo independent random samples of size mi = “nd N (yg, 02) respectively’ yield £2 = 13.6 and SP oy ‘ “saytit Give an outlay for'a'5 x 6 contingency table. « .quare test of Ho: ‘4 and B are independent against iy Give a step by step procedure for a chi-s 1: A and B are not 3 sndependent, IFA and B are two random variables. «ty Iris believed that success in Pre-depree programme is related to performance in mathematics. ‘The following dats $.ta) List out the b (tb) Let the random vs fay = ste" i y= eo é collected and summarized in a contingency table below, Perfornvance in mathematies | iT Average Tigh IE 5 = Ist . WV 2 1s” = this believe or otherwise at 0.005 level of si properties of an estimator arid define the word Reliability in statistical estimation, le X be a gamma distribution with parameter @ and pdf given as Show tae (i E[X] =£Gi) a= E ©) Lett, Ago: Ka be a random sample from a Bemoulli distribution ~ 0) = (O71 100 = (O cthanvtse | *€00 Wind 3 uniformly mx i he iformly most powerful test for testing Ho: @ = Oy against Hy: 8 = Wa) Define analysis of variance (ANOVA) ‘Scanned with CansScanner itference gn in one way analysis OF variance, is there any signific 1b) Discuss the concept of a balance d i between balanced and unbalanced design in the computation of sum oF squares Formular'? nufacturer, it is q ic fibre use we cloths for men shi is oF interest to the (c) the tensile strength of @ synthetic fibre used to make cl ; facet suspected that strength is affected by the percentage of cotton in the fibre, Five levels of cotton percentage are interest 25%, 30% und 35%, Fi jos are to be taken at-cuch lev! of cotton percentage. Tes! 5% level of signiticance whether the percentages of co:ton affect the strength of the libre. (—“Tereentage of cotton Observations. 2 SE i 1 _| 4 5 7 7 01 9 Tz 8 18 14 19 19 19 7 am 5 (a) What are the problems associated with unequal number of observations in cells of a design? (b) State the fixed effect and the random effect model as it relates to assumptions of unbalanced data for wo way analysis of variance, (¢) Six different machines are being considered for tse in tianufweturing rubber-seals, Machines are compared with respect to the tensile strength of the product. A random sample for each machine is used to determine whether ‘or not the mean tensile strength of the product, A random samp‘e for each inachine is used to determine whether or not the *mean tensile strength varies from one machine to another, The following measurements were taken. Test, at 5% significant level, if the mean tensile strength varies from one machine to another. MACHINES i 2 3 Th: 6 7 ig 7 16 a ic fis 16] 19 19 16 at a 7] 6 re 18 i fs T 20 = 5 20 : Ne i lm 7 6 (a) State the model for a two way unbalanced analysis or variance and by method of least Squares, e50 paran:sters involved'in the model. ; z (b) Set up an ANOVA table for this kid of desig (c) Five different machine operators engaged in an industry to handle various types of prodution equipmesjt fur the manifacturing of its products have in records the following thformation'about the number of products (in jnillions) produced for a two year assessment period.” : EQUIPMENT/OPERATORS | A a c DE i E é 0 scp = fe 13 14 1s 8 2 3 weer 7 Ey 12 : 8 Carry outan analysis of ve é level of significance the hypollesis that (1) Performance of machine operators are the same (ii) Equipments are the same, et "° ED “ aaerk ; Q tert We Leo! ‘Scanned with CansScanner | Chains Outlnn Sem asian DEPARTMENT OF COMPUT! E UNIVERSITY OF CALABAR DATE: 19"November, 2019 CALABAR NIGERIA * AL EXAMINATION: SECOND SEMESTER CODE: CSC202 COURS ACADEMIC SESSION: 2018/2019 COMPUTER PROGRAMMING IT Hours snowerany fone questions.Do not write on your question paper.And Note that Phones are not allowed in the " eee IMZON | OFPIOMG hat is strmetun briefly on its major components.(7 Marks) Discussed the problems associated with unstructured programming and show how you can overcome this problem. 8 Marks) : wcF oF a newsagent pays two different rates for the delivery of newspapers. A worker can earn NI.S0 on a ing delivery, but only N1.20 on an evening delivery. workers are employed for either a morning paper-round or norning and evening paper-rounds. program to input at the keyboard the description of round (e.g. AM or PM) and the uiher of complete-paper rounds in a week made-by a worker: Calculate the cross weekly earnings and output your uiltto the sereen of a monitor.(10 Marks) ‘thie aids of simple program structures, clearly differentiate between subroutines and blocks.(8 Marks) inpare and contrast object-oriented programming and structured programming.(8 Marks) What are control structures? Hence, with the aid ofa simple program, discuss any three control structures known to sou.(9 Marks) With the aid ofa simple examples, clearly differentiate between the following (i) Pseudocode algorithm (ii) Flowchart ter program. (9 Marks) Explain the concest of problem solving using the computer.(8 Marks) V icorge Polya, an authority in piodtem soiving, thas divided one problem solving into four steps activity: comment briefly on these four steps activity known to you.(8 Marks) : z the theoret'val model approach, sort any one of the arrays Lists beiow ws ()) Selection Sort algorithm: Array A = (SORTEXAMPLELISTS} (ii) Insertion Sort algorithm: Array B = (41, 8, 3, 4d, 19, 13,23, 18, 2}. And Show clearly the order of the elements after each,pass.(8 Marks) Explain why finear search algorithm has different timecomplexities(O(1) and O(n)) in different scenarios.(5 Marks) Using diagrams with examples, explain the concept ofstable and unstable sorting algorithms, With examples of » singinreallifescenario=, discuss why sorting is important to programmers and in everyday life?(12 Marks) Exuninationt ; evening paper-round but not both con Given an ordered and an if-ordered arrays, state the search algorithms you would preferred to use in searching for an item on each arrey to achieve maximum efficiency. Showing examples and stating the reason for your choice.7 Marks) ‘Write down the algorithms or the pseudocodes for one search technique you mentioned above and stzteits time complexity.(10 Marky) ” with 9 integer elements and apply any of the named search techniquesin (5a) above to arch for the element in the 7" position (either key= A[7)).(8 Marks) hat do you understand by fecursion and recursive algorithms. Using concrete examples, list aru explain two tenes of recursive algorithm. Staie why recursive algorithms may result to stack or memory overflow error if the base case of the algorithm is omitted or not properly defined.(10 Marks) Clearly document at least four of the rules in writing recursive algorithms. (5 Marks) Given the following recursive method to perform product multiplication, trace the function Func(S, 90) and show all calls and return value. Using the table header below as guide to compute your answers, public static int Func(int A, int B) (10 Marks) { | i | | Create an array “s fil (B==0) return 0; else if (B %2 = 0) return Func(A+A, B2); 1 return Func(+d, B/2) +A, int y) | Condition Call return Return value Fune(int ‘Scanned with CanScanner SIMON OfFrong gates DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF CALABAR, CALABAR. CONTINUOUS ASSESSMENT SHEET FOR 2017/2018SESSION Instructions: Answer_All_Questions on CSC 202. La) What are Data? Hence write down the declaration of any three (3) simple and three (3) structured data types known to you. b) With the aid of a computer program, draw.a flowchart and an algorithm, to compute the average of any five (5) intgers. 2? Hence with the aid of a simple program differentiate c) What is computer programming d state the advantages of modular between monolithic and modular programming an programming over monolithic programming. 2a) What is a structured program? Hence comment briefly on its major components. b) What are control structitres? Hence discuss the syntax of any five (5) control structures. known to you in any programming language known to you. ©) With the aid of simple declarations differentiate between local and global variable in any’ language known to you. 3a) Discuss any two (2) approaches of programming language design known to you and mention any two (2) languages known to you whose design approach falls within the design approach you have mention. b) Comment briefly on the following programming terms; (i) Block (ii) Method (iii) Procedure (iv) Function (v) Subroutine c) With the aid of a simple program code differentiate between object oriented programming and structured programming concepts. 4a) George polya, an authority on problem solving has divided 1 problem solving into four step activities, comment briefly on these four step activities. b) What is a sofiware life cycle? Hence comment briefly on the components of a software life cycle known to you. c) When a computer programmer is coding his code in any programming language, two (2) type of error may occur, comment briefly on these errors and state clearly who will detect and eradicate each of these errors. 5) Differentiate between the syntax and semantic rules of a programming language known to you. ‘Scanned with CansScanner OF Ol2 Fy koe,” UNIVERSITY OF CALABAR, CALABAR DEPARTMENT OF COMPUTER SCIENCE SECOND SEM AMINATION 2019/2020 COURSE CODE: € SC 242. COURS! FUNDAM NTALS OF DATA STRUCTURES TIME: 2 HOURS DATE: 31" JULY, 2021 INSTRUCTION: ANSWER ANY FOUR (4) QUESTIONS. la) What is a data structure? How does a data structure differ from a data type? b) What is an algorithm? Discuss the relationship between an algorithm and a data structure ifany c) Given a set of k elements, where k is a finite integer, what is the most suitable algorithm to arrange these elements in order of magnitude? Give the pseudocode of the algorithm you have chosen. 2a) What do you understand by an array? Give the syntax ofa one dimensional array of 10 ~~ elements in C++ or Java hence write a code segment that uses an array to compute the Ps sum of n elements. b) Discuss the operations supported by an array. ©) _ Using an algorithm, explain the process of scarching an array for a given element. , With the aid of diagrams and code, briefly discuss a linked list. Give the openers gia list. Using C++, create a linked list of integers. - Show spect Been ee al ‘ ‘Scanned with CansScanner oe DEPARTMENT OF COMPUTER SCIENCE b SECOND SEMESTER EXAMINATION 2019/2020 ACADEMIC SESSION CSC 232 - FOU NDATIONS OF SEQUENTIAL PROGRAM INSTRUCTION: ANSWER QUESTION ONE AND ANY OTHER THREE QUESTIONS TIME: 2HOURS DATE: 03/08/2021 MZON CEAONK Quem 1 <25 MARKS> J a By Gompte te Bi wo's complemen binary encodings of67, 67, and -- 67 t0 ; 5 Bo arram i running on a specific computer with the folowing parameters: (a) Total executed instruction Count = a 1 EPI forthe program = 6.25 aid (c) CPU cock rate = S002 What is the 30,000,000 instructions, (b) Averag -xecution time for this program? a the basis of which it produces an output control signal wl )A control unit has set of input values on o-operation, Briefly explain the input sources of the control unit vont pee bular form, clearly depicts the relationship 4) () Cleary categorize micro-operations performed by the CPU. (ii) In a tat ‘among hexadecimal, decimal, octal and binary number systems. hich in turn performs Question 2 <15 MARKS> a) Ina computer program, what are the elements of an instruction? b) Let assume that a benchmark has 100 instructions: 25. instructions 2fe oadsistores (each take 2 cycles), 5! instructions are adds (each takes 1 cycle) and 25 instructions are square root (each takes 50 cycles). What is th CPI for this benchmark? ¢) ( What are the basic features of RISC and CISC processors. (i) Technically differentiate Dynamic RAM (DRAt from Static RAM (SRAM). ~ Question 3 <15 MARKS> 4 the programmer can write programs to directly access every feature of a) Using assembly language programming, processor, Give three instances and cite example in each case 'b) What led to the switch from Machine language to Assembly language programming? ¢) State the major advantage of machine language over Assembly language Question 4 <15 MARKS> a) What does Assembly language use for program instructions? _ b) The symbolic representation of the opcode (machine level instruction) is called ¢) State the iormat in which Machine language is written and the format that Assembly language is written Se 5 <15 MARKS> a) The compilation process is i i ate di te ae ; a sequence of various phases. With appropriate diagram, explain 4 phases inv: p Sia a the three sections in an assembly language program ) ly language program consists of three types of statements. State and explain these statement: ments, Question AS MARKS> fees + me ap saa concept ofa language processing system segmented S x it it : tree (3) segments you know, Syslem memay iio groups ofindependet segments. Brey @ [een three differences between a Compiler and an Interpreter, 4 Ee ade, white iin eee . ‘Scanned with CanScanner i re cS ON RS) ON UK DEPARTMENT O! PHYSICS »\ ELECTRICITY, MAGNETISM AND MODERN PHYSICS (PHY 152) ‘SECOND SEMESTER EXAMINATION 20172018 SESSION INSTRUCTION: ANSWER ALLQUESTIONS TIME: 90 MINUTES ke advantage of your understanding of Coulomb’s Law af electricity, explain with the aid ofa diagram the interaction between ees. Weulate the electric force of attraction between the electror and the proton in a hydrogen atom assuming their distance of separation is 5.3x10°!' m (e=1.63x10""C, K=9.03x10"'? Nm?/C?). na SnC test charge is placed at a certain point, it experiences a force of 8x10“N in the X direction. What is the eiectric field ‘at that point? If an electron is placed in this field, what ford will be exerted on it? (Take e=1.6x10"C and k=9.0x10°Nin?/C?), ‘are the implication of Gauss’s Law. Find the force acting between two charges of 2.9 x 10%C and 4.0 x 10*C are placed 6.0 m apa fn @ vacuum. { 6nsider a point A which is 85 cm north of @ point charge -45x10°C and a point Is which is 60 cm: west of tne civarge. Dererm teat ee nelace Grdetie 1 deeelly Potent ek . VacVe. V Explain Ohm’ z IX What is the difference between Electrolytic and non-clectrolytic capacitor? “9. Derive the capacitance, voltage and charge of three capacitors connected in parallel the charge on each of the capacitors shown in the diagram below as well as the potential difference across each capacitor. [wr] Gye GrorG> gratry = i) pete MS WKle 7 golp 11. Explain with aid ofa diagram the effect of magnetic field on a moving charge. 12. State the epplication of Bio-Savart Law. 13. A magnetic field of 3.4x10°°T exist at the centre of a circular coil of radius 40cm having 30 closely wound turns. Find the current in the turns. 14, From classical mumentum, derive an expression for relativistic momentum, taking into cognizance, time dilation as a consequence of special relativity. (b) A particle of mass 0.5kg is moving with a veiccity of 2.1 x 10° m/s in an insrtial frame of refereace S’_ rélative and parailel to a second inertial reference frame S. Ifthe time, t as measured in the reference frame $ (56.3 miec, caicuiate (i) the speed paran.ter (fi retativ or fcke © = 209-202 458 m/e} “unsatisfactoiy picture of the atom from Rutherford theory, Niels'Bohr-used tH® diagram below to arrive at hie ‘Scanned with CansScanner DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY OF CALABAR 222 (SURVEY OF JON - CSC mat IN 2 HOURS ~ 09/08/2021. © SEMESTER 2019/2020 EXAMI "ANSWER QUESTION 1 AND ANY OTHER TWO QUESTIONS 1 (30 marks) _ ab ow the expression k written in FORTRAN and in C Complete the following table: __ iz Taal [Language Type —_| Its attribute fin Uses binary codes tL Uses mnemor and symbols ‘Uses human-like expressions for English and i mathematical notations = —__+ Define a formal language L with respect to some alphabets D and > a ation for expressing the syntax of a language while ~~ is used in expressing tHe lexical structure of tokens. What is the primary purpose of garbage collection? ‘What is primary objective of type checking in computer program! The two types of binding are __and _ ‘Syntax is about the- “Structures, semantics is about understanding the sentences in programming languages a } The procedural paradigm in the introduction of the Von Neumann architecture was a crucial step in the development of electronics, the basic idea is that instruction can be s and stored in the memory of the computer } The attributes of a grammar is a technique used to describe more of the ~ that tl --=--grammar. ¢ + QUESTION 2 (20 marks) i, When do we say a language is statically typed? Mention any two languages that use static, typing Using the type theory, explain what the declaration Mf(Kn) {N; return x;} means Given the program segment > int {(float j) i 7 ils } Specify which variable occurs free and which one occurs bound, stating why. QUESTION 3 (20 marks) i, Name the four components of a language syntax List out the three elements of a language syntax iii, Express a = (e+6.1) * s_4; in Java language into Lé oF ivy. Poreach of the expressions int x; and int Pe ue a oe t State which one is statically bound and which one i i and dynamic binding occur in a program? Ce a Me QUESTION 4 (20 marks) . In memory management, there is a concept that d scat sed Whats ths concep? Define the eta Sines how memory is wasted if not relaimed after bin n the runtime errors that type declaration cannot Vien ee a scope of a variable differ from its extent ee 2 following program segment in ALGOL-6 ite it nei ; and extent of x and k respectively. ®. rewrite it in either Java or C++, specifying tl m? Disadvantage Return m4; i | j does each of stati 4 fi ‘Scanned with CanScanner UNIVERSITY OF CALABAR, CALABAR DEPARTMENT OF STATISTICS CONTINUOUS ASSESSMENT FOR STA 281 (STATISTICAL INFERENCE) INSTRUCTION! ANSWER ALL QUESTIONS department in the space provided. You oan ai fra sheets. To be submitted on or before NO” June, 2021 NAN MATRIC NO. DEPARTMENT vutlay for a $x 6 contingency table re test of Ho: A and B are undent, if A and B are two random ii, Give a step by step procedure for a Chi-Squa independent against 1,:A and B are not indepe variable &) performance in mathematics. The following _ contingency table below; Performance in mathematics believe that success that suecess in pre-degree programme is related to data were collected and summarized in a ‘Confirm this believe at 0.05 level of significance. 2 (@) The table below shows a researcher's decision and consequences in taking certain ecision in a hypothesis testing. Complete the table in terms of probability of or testing Hy: @ = 89 againstH: @ = 6. mples of size n, = 16 and n2 = 10 taken from d N (i, 03) respectively yield 2, = 14.9, ‘Scanned with CansScanner 4 () In 1988 the number of new cases of insulin dependent diabetes in children under the age of 15 was 1495. The table below breaks down this figure according to age and ‘Scanned with CansScanner OIRO CrtTtONG UNVERSITY OF CALABAR, CALABAR DEPARTMENT OF STATISTICS SECOND SEMESTER 2019/2020 EXAMINATION Isp CODE: STA 282/222(STATISTICAL INFERENCE) TIME: TWO HOURS RUCTION: ANSWER ANY FOUR QUESTION (a) Define the following terms a. Point estimate b. Pivotal statistic ¢, Maximum likelihood estimator of 8. (b) Let X~N(, 0). Given a random sample of size'n, X;, Xap wa Xq. Obtain fd and 6? using the method of moment. \dom variable X with (c) Let X1, Xo, «» Xx be independent random sample of 0 observations on the ran the exponential density function f(x;a) =4e"® x > 0, Determine the maximum (d) The result of an experiment involving two pop ny = 6,N = 10,X, = 80,X, = 51,5, = 25,5, = 25 independent and normally distributed, with unequal but confidence interval for the difference in the two population mean. likelihood estimator of a. ulations is summarized as follows; ‘Assuming that the two populations are unknown variance, construct a 95% 2. (a) Outline the steps involve in hypothesis testing (6) An automobile manufacturer collects mileage data for a sample of n =10 cars in various weight categories using a standard grade of gasoline with and without a particular additive Of Course, the engines were tuned to the same specifications before each run and the same drivers Were used for the two gasoline conditions. Given the mileage data in the table below. test that there is no difference between the mean mileage obtained with and without the additive, using 5% level of significance. Mileage with 36.7 34.8 30.7 28.3 27.5 25.7 24.3 ae 20.9 19.3 additive Mileage qithow | 36.2 | 347 | Bld | 286 | 261 | 258 | 23.9 | 221 | 204 | 190 additive (6) Inan experiment involving 4 different populations, random samples of size n=9 is taken from each population and the sample variances are 80, 52, 63 And 60. Use the Cochran test to test the hypothesis Hoi? = of = 03 = of agai H,:the four population variances are not all equal. At a = 0.05. 3. (a) Select all possible samples of size 2 from the population consisting of 1, 3, 5, 7 and 9, if sampling is done without replacement and hence construct it's sampling distribution. (b) An auditor wishes to test the assumption that the mean value of all accounts receivable in a given firm is $260.00 by taking a sample of n=36. Given tat the sample mean and deviation ofthe accounts receivable amount is known to be s = $43.00 and # = $240.00. Test this hypothesis at 5% levels of significance using the P-value approach. (©)A manufacturer of electric bulb claims that the life span of his bulbs is approximately normally distributed with a standard deviation of ¢ = 3years. In a random sample of three bulbs th teed mena spd vrnace i 79 and 16. Ase hen ts sages x disagreement ‘manufacturer at 0.1 level of significance? sh a ¢ ‘Scanned with amScanner A ut racy table (ii) Give a step by step procedure for a chi-square test of 4. (a) (Give an outlay for a 5x6 continge "Aand B are not independent, if A and B are two random Ho; A and B are independent against Hi: variable. ram is related to performance in mathematics. The # © (b) itis believed that success in pre-degree pro ney table below following data were collected and summarized in a continge! Performance in mathematics Tow ‘Average High 4 8 3 12 31 TT 7 oy 18 Confirm this believe or otherwise at 0.005 level of significance. 5. a. (i) Define analysis of variance (ANOVA) (ii). write out the model design (CRD) and define all the terms wut for the complete randomized design revision sets is interested inthe effect on tube conductivity of four di folloviing conductivity data were obtained. J of one way complete randomized b. Give the Data layot ifferent types c. A manufacturer of tel of coating for colour picture tubes. Th [ Coating type Conductivit 5) 1 143 141 150 146 Bi 152 149 137 143 3 134 136 132 127 4 129 127 i 129 is there any difference in conductivity due to coating type? Use a=0.05 6. (a) Five coins are tossed 400 times and the numbers of samples that contain 0,1,2,3,4 or 5 tails are observed. The observed frequencies are given below. Number of [0 T 2 3 7 3 tails Observed [5 50 100 780 5 30 frequency Determine the goodness of fit of the Binomial distribution to these dafa using o=0.01 (b) Verify using goodness of fit test ifthe distribution below provide sufficient evidence to contradict the claim that the distribution is normal. Use a=0.05 35.95- | 37.45- 4 paecdessbistdie! Ee ‘Scanned with CansScanner

You might also like