Download Exam Info for Advanced Programming in Business Info Systems at NUI Galway and more Exams Computer Programming in PDF only on Docsity!
Ollscoil na hÉireann, Gaillimh GX_____
National University of Ireland, Galway
Semester 1 Examinations 2010/20 11
Exam Code(s) 3BF
Exam(s) Third Year BSc in Business Information Systems
Module Code(s) MS
Module(s) Advanced Programming
Paper No. 1
Repeat Paper
External Examiner(s) Dr. D. Ivanov
Internal Examiner(s) Dr. T. Acton
Instructions: Answer any THREE QUESTIONS.
All questions carry equal marks.
Duration 2 hrs
No. of Answer books
Requirements :
Handout
MCQ
Statistical Tables
Graph Paper
Log Graph Paper
Other Material
No. of Pages 7 including this page
Discipline(s) Business Information Systems
OLLSCOIL NA hÉIREANN
NATIONAL UNIVERSITY OF IRELAND, GALWAY
SEMESTER I EXAMINATIONS 2010/20 11
THIRD YEAR BSc. IN BUSINESS INFORMATION SYSTEMS
EXAMINATION
(MS315) ADVANCED PROGRAMMING
Dr. D. Ivanov
Dr. T. Acton
Time Allowed: TWO hours
Answer any THREE QUESTIONS. All questions carry equal marks.
Q1.
Use an array to solve the following problem: Write a Javascript to read in 5
numbers from the user, each of which must be between 1 and 20. As each
number is read, display it on the screen only if it is not a duplicate of a number
that has already been read. Try to use the smallest possible array to solve this
problem.
For example, if the user enters 15 2 16 15 4 the output may resemble 15 2
16 4 or if the user enters 24 13 4 9 4 the output may resemble 13 4 9
The partially completed script is provided below (you do not need to rewrite
the provided code in your answer).
Q1
Click Refresh (or Reload) to run this script again.
(33.3 marks)
**<xsl:value-of select = "product/@name"/> **
** **
calories fat cholesterol carbohydrates salt protein
total:
total:
total:
**
fat: ** saturated:
fibre:
"carbohydrates/fibre"/>
unsaturated:
sugars:
figure 1: Browser output (33.3 marks)
Q3.
Describe the purposes and usage of each of the following technologies. In
each case give a short example (in code) of a business-related implementation.
(a) Cascading Style Sheets
(b) Common Gateway Interface (CGI)
(33.3 marks)
Q5.
(a) The following script has 4 distinct syntactical or logical errors on 4
separate lines. The purpose of the script is to sort a numerical array j in
ascending order. Indicate the line numbers where the errors are located, and
give the correct line of code in each case.
01 02 04 05 06 07 08 09 10 Sorting an Array 11 12 38 39 40 (12 marks)
(b) A palindrome is a number or case-insensitive text phrase that reads the
same backwards as forwards. For example, “ABBA”, “madam”, “able was I
ere I saw elba”, 24542, 6770776, B2B and 7007 are all palindromes, whereas
“Sligo beckons” is not. Using a language of your choice write a program or
script that reads in a 3-digit integer and determines whether it is a palindrome.
If the user enters anything other than a 3-digit integer, output a message to that
effect using an information message dialog or other mechanism, and allow the
user to enter a new value after dismissing this message.
(21.3 marks)