You are on page 1of 4

W1-2-60-1-6

JOMO KENYATTA UNIVERSITY OF AGRICULTURE AND TECHNOLOGY


UNIVERSITY EXAMINATIONS 2014/2015
STAGE II EXAMINATION FOR DIPLOMA IN BUSINESS INFORMATION
TECHNOLOGY
DIT 0204: INTRODUCTION TO OBJECT ORIENTED PROGRAMMING
DATE:DECEMBER 2014 TIME: 1.5 HOURS
INSTRUCTIONS: Answer question one (compulsory) and any other two.

QUESTION ONE (30 MARKS)

a. Explain the differences between the following terms? (10 marks)

i. Object and Class.

ii. Object oriented programming and structured programming.

iii. Object – oriented Analysis (OOA) and object-oriented Design (OOD)

iv. Inheritance and polymorphism.

v Sequence diagram and class diagram.

b. Explain what is meant by the term robustness analysis as used in object oriented
programming. (2 marks)

c. Define the term ‘unified modeling language’ (UML) and describe the way in
which the UML can be used to design an object oriented program. (5 marks)

d. Explain the following terms as used in Java programming. (5 marks)

i. Java virtual machine

ii. Java development kit

iii. Javac

iv. Java bytecode

v. Path (classpath)
e. Name Two structural and Two behaivioral UML diagrams. (4 marks)

f. Describe four features of the UML and explain how the are used in the design of
object oriented software. (4 marks)

QUESTION TWO (20 MARKS)

a. What are member access specifiers and how are they represented in a UML class
diagram? (5 marks)

b. What are aggregation, composition and inheritance and how are they
represented in a UML class diagram? (5 marks)

c. Some object oriented programming languages, such as python, are interpreted.


Others such as C++ are compiled. Distinguish between the terms interpreted
and compiled. (6 marks)

d. Define two types of relationships use din UML (4 marks)

QUESTION THREE (20 MARKS)

a. Below is an example of a basic java program (HelloWorld)

1: Public class HelloWorld{


2: /*this is my first java program,
3: Public static void main (string [] args ){
4: System.out.println(“Hellow World”);
}
}

i. Explain the line of code (1-4) above. (8 marks)

ii. What will be the output of the program. (1 mark)

iii. Explain two ways you can write a java program. (2 marks)

b. Write a java code to show creation of a class and object. (6 marks)

c. Write the output of the following java inheritance code (3 marks)

Class A{

Public void fun (ints){


system.out. println(“int in A is:”+x);
}
}
Class B extends A{
Public void funz (int x, inty){
fun (6)
system.out. println(“int in B is:”+x” and “+
y);
}
}
public class inherit {
public static void main (string [] args){
B obj=newB();
obj.funz(2,5);
}
}

QUESTION FOUR (20 MARKS)

You have been asked to advise the manager of an IT department on the choice of
programming language. The manage wishes to know whether the use of an object,
oriented programming language would increase programmer productivity. Write a
report that set out the potential benefits and disadvantages of deploying an object
oriented language. (15 marks)

b. List and explain five application of object oriented programming language.?


(5 marks)

Wrekin Trotters is a running club for members of all abilities, from beginners to athletes
who represent their country. If a new member wants to join the club they can register
their details online, by providing their name, address, telephone number, and
emergency contact name and telephone number.

During the week the club runs several activities, for example speed work and training
runs. These activities are advertised in a club Diary, which is produced and put online
by a committee member.

During the year, the club runs a number of external events that are open to both
members and non-members of the club, for example the wrekin Half marathon.
Runners must register for each even separately even if they are members of the club.
Entrants need to provide their name, address date of birth, fee payable and club name.
One week prior to the event, a committee member will produce a race number for the
event which is posted to the entrant. Each event has a maximum number of
participants and once the limit is reached, no further entries are allowed. For each
event, several administration tasks have to be.

QUESTION FIVE (20 MARKS)

Carried out by a committee member, such order refreshments and models. A record
needs to be kept of the date these were ordered and the quantity for insurance
reasons a member of the committee must also register the event with the Amateur
Athletics Association (AAA).

The club has a league for its members the results from the club events, and other
external events, are recorded online by each member and at the end of the year prizes
are awarded for various categories such as the Bet overall senior Runner, or Bet
Newcomer Runner.

a. Draw a use case diagram for the Wrekin Athletics Running Club. (10 marks)

b. Discuss how use case diagram and scenarios contribute to the development of a
system. Within your answer include an example scenario from the Wrekin
Athletics Running club. (10 marks)

You might also like