Exam Document: Data Programming Fundamentals - Autumn Examinations 2010/11, Exams of Computer Fundamentals

Instructions and questions for the data programming fundamentals exam held at cork institute of technology in autumn 2010/11. The exam covers topics such as entering dimensions of a room, calculating room area, pass by reference, string manipulation, pointers, and file processing.

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
CORK INSTITUTE OF TECHNOLOGY
INSTITIÚID TEICNEOLAÍOCHTA CHORCAÍ
Autumn Examinations 2010/11
Module Title: Data Programming Fundamentals
Module Code: SOFT 6011
School: Mathematics & Computing
Programme Title: Bachelor of Science in Computing Year 2
Higher Certificate in Computing Year 2
Bachelor of Science (Honours) in Software Development Year 2
Programme Code: KCOMP_7_Y2
KCOME_6_Y2
KSDEV_8_Y2
External Examiner(s): Mr. Peter Given
Internal Examiner(s): Ms. G. McSweeney
Instructions: Answer Q1 and two other questions.
Duration: 2 Hours
Sitting: Autumn 2010/11
Requirements for this examination:
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 Document: Data Programming Fundamentals - Autumn Examinations 2010/11 and more Exams Computer Fundamentals in PDF only on Docsity!

CORK INSTITUTE OF TECHNOLOGY

INSTITIÚID TEICNEOLAÍOCHTA CHORCAÍ

Autumn Examinations 2010/

Module Title: Data Programming Fundamentals

Module Code: SOFT 6011

School: Mathematics & Computing

Programme Title: Bachelor of Science in Computing – Year 2 Higher Certificate in Computing – Year 2 Bachelor of Science (Honours) in Software Development – Year 2

Programme Code: KCOMP_7_Y KCOME_6_Y KSDEV_8_Y

External Examiner(s): Mr. Peter Given Internal Examiner(s): Ms. G. McSweeney

Instructions: Answer Q1 and two other questions.

Duration: 2 Hours

Sitting: Autumn 2010/

Requirements for this examination:

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

Section A You are required to write parts of a program which does the following

Find the number of rolls of wallpaper required to fit a room with dimensions length by width by height

(i ) Using reference variables write a function called enterDimensions to enter the length, width and height of the room returning these values to the main program 3

(ii) Write a function called calcRoomAreaWithoutDoornWindow t hat takes in the room length, width and height and calculates the area of the room and returns the area as a reference variable There is one door in the room with the dimensions :( width 1.5 m and length 3.5 m ) There is one window with the dimensions ( width 2.5 m and length 2.25 m) 5

(iii)Write a function called findAreaOfRoll which passes the length of each roll from the main program. The width of roll is standard 2.25m Calculate the area of the roll. This function uses pass by value to return the area of the roll

4 main program (iv ) Write the main program section to carry out (i) to (iii) above, including all the declarations and function calls 8

Section A ==> 20 marks

Question 2 String Manipulation

Section A

(i) What is the difference between reading in a string variable and a cstring variable? 2 (ii) Show how you would declare  name as a string  name as a cstring 2 (iii) How would you find the length of (a) a string (b) a cstring 2

(iv) How do you copy str2 to str1 1

(v) How do you concatenate 2 strings str2 onto the end of str1 1

Section A ==> 8 marks

Section B

Write a program which prints out text entered in the format below.


  • Some Text *

Note:  Ask the user for any number of starting characters surrounding the text.  This program should be written using strings

Include the following functions  a function called readToSurroundText which reads in the number of characters for each side of the centre line passing by reference  a function called createLine to create the text for either the top or lower line  a function called createInnerLine with the required number of characters on each side of the text

Write the main part of the code to use these functions

Section B ==> 22 marks

Question 2 ==> 30 marks

Question 4 files

(i) Compare how a sequential file with a random access file are used in file processing. 2 marks (ii) Assume each course has the same number of modules from year to year and term to term. Assume there is a max of 2000 students. Assume there are a total of 50 courses. Assume that can be 4 to 6 modules delivered per semester. There are 2 semesters per term and 4 years in total.

Set up a system to hold courses and students taught and modules delivered within.

Details held on courses include course reference number, course title , Modules taught each semester including Module Id, Module name, lecturer delivering the course and Semester delivered. Students taking the course include registration number, name and address and registrationDate.

Assume that can be 4 to 6 modules delivered per semester. There are 2 semesters per term and 4 years in total. 9 marks

(iii) Set up a function referencing Q4(iii) to do the following

(a) initialise the random access file called courses.txt (b) enter a number of course records to the random access file: enterRecords (c) delete one course from the file : deleteOneCourse

19 marks

Question 4 ==> total 30 marks