Get premium membership and access revision papers, questions with answers as well as video lessons.

Sci 204: Object Oriented Analysis Design & Programming Question Paper

Sci 204: Object Oriented Analysis Design & Programming 

Course:Bachelor Of Science In Information Technology

Institution: South Eastern Kenya University question papers

Exam Year:2016



SOUTH EASTERN KENYA UNIVERSITY

UNIVERSITY EXAMINATIONS 2016/2017

SECOND SEMESTER EXAMINATION FOR THE DEGREE OF BACHELOR OF INFORMATION TECHNOLOGY


SCI 204: OBJECT ORIENTED ANALYSIS DESIGN & PROGRAMMING

DATE: 11TH APRIL 2017 TIME: 10.30 –12.30 PM
INSTRUCTIONS TO CANDIDATES
a) Answer ALL questions from section A(Compulsory)
b) Answer ANY TWO questions from section B


SECTION A (COMPULSORY)
Question One
a) State two types of constructors used in Java. (2 marks)
b) Explain each of the following concepts as used in object oriented programming:
i) Encapsulation;
ii) Inheritance;
iii) Polymorphism; (3 marks)
c) Write a java class that extends the following abstract class. (4 marks)

abstract class Vehicle{
abstract void run();
}

d) Outline two benefits of using object oriented programming. (2 marks)
e) Each phase in the Rational Unified Process can be further broken down into iterations. Outline two factors that influence iteration length. (3 marks)
f)Write a java program that will allow user to enter three values through keyboard in an array named
marks then output the average of the three values. (5 marks)

g) Draw a use case diagram from the case study below:

Prosperity Bank has an ATM machine where a user is expected to enter card then PIN. The card and PIN are verified before the user can proceed with a transaction. The user selects the account to use then selects amount either in multiple of KES 500 or KES 1000. The amount is verified if its available. User has an option of requesting for receipt or not. The system concludes the transaction when user is provided with funds and receipt or transaction fails. (5 marks)

h)Write a java program that will allow user to enter order number through a keyboard. The program should output the details and amount for the order selected based on the following table; use switch
decision structure (6 marks)

ORDER NO DETAILS AMOUNT
1 Fried Beef and Ugali 300
2 Liver and Fries 250
3 Tilapia Fish and Rice 250
4 Fried Chicken & Fries 400



SECTION B (40 MARKS)
Answer two questions from this section


Question Two
a) Outline two rules one has to adhere to when creating a constructor. (2 marks)
b) Outline three advantages of polymorphism. (3 marks)
c) Explain the following concepts as used in Java Development Kit (JDK):
i) Jar;
ii) Javadoc. (4 marks)
d) Modify the java program below to demonstrate constructor overloading. (5 marks)

Publicclass Students {
String name;
intid,age;
public Students(int i, String n) {
id=i;
name=n;
}

void display(){
System.out.println(id+" "+name+" "+age);
}

publicstaticvoid main(String[] args){ Students=new Students(20,"Jane"); obj.display();
}

}



Question Three
a) Outline three reasons for using Exception handling. (3 marks)
b) Explain three benefits of inheritance as used in object oriented programming. (6 marks)
c) Albert downloaded the Versitycourses class shown below from the internet

import java.io.*;
public class Versitycourses{

public static void main(String args[]){ int courses[] = new int[10];

System.out.println("Access element three :" + courses[20]);

}

}

She tried to execute the class but she got a java.lang.ArrayIndexOutOfBoundsException error.
i) Explain the meaning of the above error. (2 marks)
ii) Rewrite the program to include exception handling. (4 marks)

d) Using for loop structure write a java program that will output odd numbers between 80 and 20.
(5 marks)

Question Four
a)Outline two properties of an interface. (2 marks)

b)Write a java program that will check number entered by user through keyboard, if the value is odd it should output “ODD” else “EVEN”. (5 marks)

c)In object oriented programming access modifiers can be used to implement encapsulation. Explain two
that are used in java. (4 marks)

d)Write a class that will implement the interface shown below. (8 marks)


publicinterface Register {

voidsetStudentName(String name);

voidsetStudentAge(int age);

}








SEKU/01-04/2016/2017 Page 3






More Question Papers


Popular Exams



Return to Question Papers