Exam Questions: Data Programming Fundamentals, Cork Institute of Technology, 2011/12, Exams of Computer Fundamentals

The exam questions for the data programming fundamentals module of the higher certificate in computing, bachelor of science in computing, and bachelor of science (honours) in software development programs at the cork institute of technology. The exam covers topics such as setting up dynamic arrays, functions, strings, pointers, and random access files.

Typology: Exams

2012/2013

Uploaded on 03/28/2013

mahmud
mahmud 🇮🇳

4.6

(8)

48 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Page 1 of 7
CORK INSTITUTE OF TECHNOLOGY
INSTITIÚID TEICNEOLAÍOCHTA CHORCAÍ
Semester 1 Examinations 2011/12
Module Title: Data Programming Fundamentals
Module Code:
SOFT 6011
School:
Science and Informatics
Programme Title(s):
Higher Certificate in Computing (Evening) Year 2
Bachelor of Science in Computing Year 2
Bachelor of Science (Honours) in Software Development Year 2
Programmes Code(s):
KCOMP_7_Y2
KSDEV_8_Y2
KCOME_6_Y2
External Examiner(s):
Mr Peter Given
Internal Examiner(s):
Ms Gemma McSweeney
Mr Tadhg Leane
Instructions:
Answer Question 1 (compulsory) and TWO other questions of your
choice
Duration:
2 Hours
Sitting:
Semester 1 2011/12
Requirements for this examination: None
Note to Candidates: Please check the Programme Title and the Module Title to ensure that you have received the
correct examination. If in doubt please contact an Invigilator.
pf3
pf4
pf5

Partial preview of the text

Download Exam Questions: Data Programming Fundamentals, Cork Institute of Technology, 2011/12 and more Exams Computer Fundamentals in PDF only on Docsity!

CORK INSTITUTE OF TECHNOLOGY

INSTITIÚID TEICNEOLAÍOCHTA CHORCAÍ

Semester 1 Examinations 2011/

Module Title: Data Programming Fundamentals

Module Code: SOFT 6011

School: Science and Informatics

Programme Title(s):

Higher Certificate in Computing (Evening) – Year 2 Bachelor of Science in Computing – Year 2 Bachelor of Science (Honours) in Software Development – Year 2

Programmes Code(s):

KCOMP_7_Y

KSDEV_8_Y

KCOME_6_Y

External Examiner(s): Mr Peter Given

Internal Examiner(s): Ms Gemma McSweeney Mr Tadhg Leane

Instructions: Answer Question 1 (compulsory) and TWO other questions of yourchoice

Duration: 2 Hours

Sitting: Semester 1 2011/

Requirements for this examination: None

Note to Candidates: Please check the Programme Title and the Module Title to ensure that you have received the correct examination. If in doubt please contact an Invigilator.

Question 1

Q1 Part A Write sections of a program: (1) to set up a dynamic array of strings to hold modules names delivered by a given of course. 3

(2) to set up a dynamic array of marks for the modules delivered in (Q1 (1) ) 3

(3) to include a function called readInNamesAndModules to read in the module name and marks with reference to the module array and mark array set up in (Q1(1) & Q1(2) ) 7

(4) to include a function findGPA to find the grade point average from the mark array details read in Q1(3). The function GPA which should be returned by reference. 5

(5) to include a function PassOrFail which decides whether a person has passed or failed. If a person gets a gpa < 40, then they have failed otherwise they have passed. Return a string representing pass or fail from the function using pass by value. 7

(6) to include a function findCredits which returns the credits based on the number of gpa. A 100% gpa gives 30 credits. Pass the value by reference for the number of credits back from the function 3

Part A 28 Marks

Question 2 - Strings

Q2 Part A

i) Identify the error in the following code and provide an alternative correct solution:

int main() { char str1[] = "Hello"; char str2[] = "Hello"; if(str1 == str2) cout << "Equal"; else cout << "Unequal"; 5 return 0; }

ii) Explain the difference between String and C string 3

Part A 8 Marks Q2 Part B Write a program that takes nouns and forms their plurals on the basis of these rules: a. If noun ends in “y,” remove the “y” and add “ies.” b. If noun ends in “s,” “ch,” or “sh,” add “es.” c. In all other cases, just add “s.”

In the program you must prompt for and read the input string. You must find the plural and then must print the input string and its plural out to the screen.

You can use the following data to test your code: Chair dairy boss circus fly dog church clue dish

Part B 22 Marks

Question 2 Total 30 Marks

Question 3 - Pointers

Q3 Part A

i) Explain why, when declaring and working with pointers, it is essential to know the type of data that is being pointed to.

ii) What purpose does the de-reference operator (*) serve in C++?

iii) Assume the variable declarations:

int Foo = 0; int *ptr = &Foo; Identify all of the following statements which will change the value of Foo to Foo * 2 -note there may be more than one correct choice:

  1. Foo = ptr2; 3) Foo=Foo+prt;
  2. Foo=Foo2; 4) (ptr)++;

iv) If a variable is a pointer to a structure, then which of the following operators is used to access data members of the structure through the pointer variable?

  1. ‘.’ 3) ‘*’
  2. ‘&’ 4) ‘->’

v) Briefly explain one benefit that can be gained from using pointers.

Part A 10 Marks (2 marks each)

Q3 Part B

What is the outcome of the execution of the following C++ program (explain the reason for your answer).

int main () { int firstvalue, secondvalue; int * mypointer; mypointer = &firstvalue; *mypointer = 10; mypointer = &secondvalue; *mypointer = 20; cout << “firstvalue is “ << firstvalue << endl; cout << “secondvalue is “ << secondvalue << endl; return 0; }

Part B 5 Marks

Question 4 - Random Access and Sequential Files

  1. Are cstring or string libraries used to set up fixed length strings? What is the advantage to for setting up fixed length records? Explain the advantage to the type of library for setting up random access files 7

2 Explain how to set up random access files, including  setting up a blank file  inserting an additional record  deleting a record 9

3 Set up a student record that can be used in binary files. Details included student name, identity number, address, course. Why have you chosen the given library? 4

  1. Explain the steps involved in updating a student record held in a sequential file 10

Question 4 Total 30 Marks