Mr Naja Essay

Submitted By saadnaja
Words: 294
Pages: 2

BSc Examination by course unit
ECS401

Procedural Programming

Duration: 2 hours 30 minutes

YOU ARE NOT PERMITTED TO READ THE CONTENTS OF THIS QUESTION PAPER UNTIL
INSTRUCTED TO DO SO BY AN INVIGILATOR.
There are THREE questions on this paper.
Answer ALL THREE questions.
This examination is marked out of 75 marks.

CALCULATORS ARE NOT PERMITTED IN THIS EXAMINATION.
COMPLETE ALL ROUGH WORKINGS IN THE ANSWER BOOK AND CROSS THROUGH ANY
WORK WHICH IS NOT TO BE ASSESSED.
CANDIDATES SHOULD NOTE THAT THE EXAMINATION AND ASSESSMENT
REGULATIONS STATE THAT POSSESSION OF UNAUTHORISED MATERIALS AT ANY TIME
WHEN A CANDIDATE IS UNDER EXAMINATION CONDITIONS IS AN ASSESSMENT
OFFENCE. PLEASE CHECK YOUR POCKETS NOW FOR ANY NOTES THAT YOU MAY
HAVE FORGOTTEN THAT ARE IN YOUR POSSESSION. IF YOU HAVE ANY THEN PLEASE
RAISE YOUR HAND AND GIVE THEM TO AN INVIGILATOR NOW.
EXAM PAPERS CANNOT BE REMOVED FROM THE EXAM ROOM
Examiners: Paul Curzon and Fabrizio Smeraldi

© Queen Mary, University of London (2011)

Page 2

ECS401 (2011)

Question 1
a) Explain what is meant by a String expression including an explanation of the components that make up an expression. Identify a String expression and a String operator in the following fragment of code. if (age1 >= year + age2)
{ System.out.println("Hello " + name ); } else { System.out.println("Goodbye " + name); }
[6 marks]
b) Give the final integer value of b after each fragment of code i)-iv) below is executed.