



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Semester 1 Examinations 2012/
Module Code: SOFT
School: Science & Informatics
Programme Title: BSc (Hons) Software Development and Computer Networking - Year 3
Programme Code: KDNET_8_Y
External Examiner(s): Ms Erica Gill Internal Examiner(s): Ms G MacSweeney
Instructions: Answer Question 1 and TWO other questions
Duration: 2 Hours
Sitting: Winter 2012
Requirements for this examination:
Note to Candidates: the correct examination paper. Please check the Programme Title and the Module Title to ensure that you have received If in doubt please contact an Invigilator.
Section A (i) Explain the difference between a static array and a dynamic array 2 (ii) Write two small program using (a) dynamic arrays and (b) static arrays to enter decimal numbers. 6 Point out the main differences between both programs with the respective the arrays (a) and (b) Section A => 8 marks
Section B
Write the following as a program using functions as much as possible
Set up a structure of Accounts including the account number, the customer name, the address , the date the account was opened and the balance. 7
Using files, read in the customers accounts to date into a dynamic account array 6 Deposit/ Withdrawal actions: Search for a customer account by entering the account number In the array- the customer account is either present or not. If present make either a deposit / withdrawal. For a withdrawal, ensure there is enough for a balance. Inform the customer otherwise. 9
Section B => 22 marks Question 3 => 30 marks
Section A (i) What must you do to assign a pointer to a memory address of a variable 2 (ii) How do you access a pointer to each member of a struct 2 (iii) Assuming the variables int y =0 and int *yPtr = &y Which of the following statements set y to 1 (1) yptr++; (2) (y ) ++; (3) y++; (4) (ptr ) ++; 4 (iv) How do you assign a pointer to the first element of an array 2 (v) How many bytes does a pointer move in going to the next position for an array of floats. 2 Section A => 12 marks Section B (i) Create a structure of type student which contains name, age and course. 2 (ii) Write a function to enter details of student as given in (i). Also include how call this function from the main 6
Section B => 8 marks Section C Write a function to swap values using pointer functions Also write the main code for the function Section C =>10marks