You are on page 1of 6
INSTITUTE OF TECHNOLOGY ith #3882. BLANCHARDSTOWN ‘eadenie Term [2018-2015 - Year of Study Year 1 ‘Semester ‘Semester 1 January 2015 Date of Examination | ‘Thurs 8 Jan 2015 “Time of Examination 330pm=S30m Prog Code |BNSO® | Prog Title | Hisher Diploma in| Modale | COMP HOTT Science in Computing| Code Module Title Software Engineering 1 Internal Examiner(s): ‘Ms. Irene Murtagh External Examiner(s): Mr. Michael Barrett Dr. Tom Lumney Instructions to candidates: 1) To ensure that you take the correct examination, please check that the module ‘and programme which you are following is listed inthe tables above. 2) Answer Question 1 and gwo other Questions. 3) Question 1 worth 40 marks. Questions 2,3 and 4 are worth 30 marks each, DO NOT TURN OVER THIS PAGE UNTIL YOU ARE TOLD TO DO so Page 1 of 6 Question 1 Attempt All parts of this question, [marks each] a Explain what you understand by the term control structure, stating their purpose in Java programs. b Whats the Java API? Whats the import statement used fr? . ‘What would the expected output from the following Java cade fiagment be? system. out.-printin (2) + system. out.printin (2+) system. out.printin (2) 1 systen.out.printin(): 22 systen.out printin(z)+ system. out printin (142) System. out -printin (2) 5 4 Java is considered to be platform-independent [Explain what platform-independent means ° \What is mean bythe tem variable in Java? Declare a variable num to be of type char and assign the value “yo this variable f Write a Java statement to declare and allocate a double ary temperature with 20 elements & ‘What is meant by the term reserved word in Java? List two reserved words QUESTION 1 CONTINUED OVERLEAR Page 2 of 6 ‘Write a for loop in Java that prints al ofthe even number between 2 and 1000 inchusiv, Explain what i meant by the following terms: ‘Array Name . Array Index Explain the diffrence between a local variable and global variable, (Total 40 maria} Page 3 of 6 Question 2 1) Give examples, using activity diagrams and Java code of the following repetition contro stuetures and explain the differences between each: i for A while (10 Marks i) Thre fundamental concep in programming ae: sequence, selestion and iteration. Explain in detail the meaning of EACH of these three programming concepts (12 Marte) iv) Define the function ofthe following operators in Java: (B marks} {Total 30 Marks} Page 4 0f 6 Question 3 4) Sate the format ofa method definition fora method that caries out some scton and returns a value. This method may also be passed parameters. (4 marks) "Explain clearly what you understand by EACH of the following erm in the context of Java methods: i. Amethods return ype ii, Thereserved word: void Method parameters (@ mars) ili) Distinguish clearly using Java code examples the difference between void and ‘non-void Java method, (6 marks} vi) a Write amethod called binarySeareh in Java code to implement binary search on a sorted, single dimension array of type in (Marks) 1, The method should return the index key value, ifthe value is found and-Lif the vals is not found, (Marks) [Total 30 Marks} Page 5 0f6 Question 4 i) Toprocess an event, programmer must perform fo Key tasks Identify and desribe these two tasks (Marks) fit) Outline the Function ofthe ActionListener interfce in Java, List one other listener type that we ean use in Java (Maris) [Explain what you understand by the following terms: Encapsulation b, Inberiance (6 Marks) iv) Write Java code to perform the following object-oriented programming tasks: Define elas called Student, b. Define the following attributes: name, address und email, ‘6, Define a constructor to iniilise the atsibutes, 4. Define a default construetor to initalise the atribues to appropriate efault values © Define method called display to printout the values of the atributes Add statements to instantiate two objects of class Student named st and 2. (16 Marks) {Total 30 Marks Page 6 0f 6

You might also like