Object Oriented Programming Ii Question Paper

Object Oriented Programming Ii 

Course:Bachelor Of Science In Information Technology

Institution: Kca University question papers

Exam Year:2011



UNIVERSITY EXAMINATIONS: 2010/2011
SECOND YEAR EXAMINATION FOR THE DEGREE OF BACHELOR OF
SCIENCE IN INFORMATION TECHNOLOGY
BIT 2204: OBJECT ORIENTED PROGRAMMING II
DATE: APRIL 2011 TIME: 2 HOURS
INSTRUCTIONS: Answer question ONE and any other TWO questions
QUESTION ONE
a) Outline SIX features of object oriented paradigm [6 Marks]
b) define the following terms
i) inheritance
ii) polymorphism
iii) dynamic binding
iv) message communication [8 Marks]
c) Given 4 benefits of object Oriented programming [4 Marks]
d) Give 6 features of Java Programming Language [6 Marks]
e) Java standard Library (or API) includes hundreds of classes and methods grouped into several
functional packages. List 4 of the most common packages [4 Marks]
f) describe how you compile and run a java program [2 Marks]
QUESTION TWO
a) Describe THREE Jump statements used in JAVA [6 Marks]
b) Give a description of their following statements as used in JAVA
i. synchronization
ii. guarding
2
iii. iteration [6 Marks]
c) Write a program in JAVA that would count their numbers of argument passed at their command
line. Explain how you would run the program [4 Marks]
d) Variables are the names of storage locations. After designing suitable variable names, we must
declare them to their compiler. Declaration does Several things. List two of these [4 Marks]
QUESTION THREE
a) Give and describe three classification of Variables in Java [6 Marks]
b) write a program to determine the sum of the following harmonic series for a given numbers n
1 + ½ + 1/3 + ¼ + ... + 1/n [4 Marks]
c) write java statements for the following equations
i. area=?r2 +2?rh
ii. torque= g
m m
m m *
1 2
2 1 2
+
iii. side= a2 + b2 - 2ab cos(x) [3 Marks]
d) Given a list of Marks] ranging from 0 to 100, write a program to compute and prints their numbers
of students who have obtained Marks] in the range of 81 to 100, 61 to 80, 41 to 60 and 0 to 40 the
program should use a minimum number of if statements [7 Marks]
QUESTION FOUR
Following is the Floyd''s Triangle
1
2 3
4 5 6
7 8 9 10
11 ... 15
.
.
79 .. .. .. .. 91
a) write a program to print this triangle [6 Marks]
3
b) Modify the program to procedure the following form of Floyd''s Triangle
1
0 1
1 0 1
0 1 0 1
1 0 1 0 1
... [6 Marks]
c) A cloth showroom has announced the following seasonal discounts on purchase of items
Purchase Amount Discount
Mill Cloth Handloom Items
0-100 ____ 5.0%
101-200 5.0% 7.5%
201-300 7.5% 10.0%
Above 300 10.0% 15.0%
d) Write a program using switch and if statements to compute the net amount to be paid by a
customer. [8 Marks]
QUESTION FIVE
a) The numbers in the sequence
1 1 2 3 5 8 13 21...
are called fibonacci numbers. Write a programming using a do...while loop to calculate and
print the first m fibonacci numbers
(Hint: After the first two numbers in the series, each number is the sum of the two preceding
numbers) [6 Marks]
b) describe FOUR visibility control in JAVA [4 Marks]
c) Assume that a bank maintains two kinds of account for its customers, one called savings account
and the other account. The savings account provides compound interest and withdrawals facilities
but no cheque book facility. The current account provides cheque book facility but no interest.
Current account holders should also maintains a minimum balance and if the balance falls below
this level, a service charge is imposed.
4
Create a class called Account that stores customer name, account number, and type of account.
From this derive the classes Curr-Acc and Sav-Acc to make them specific to their requirement.
Includes the necessary methods inorder to achieve the following tasks
• accept deposit from a customers and update the balance
• display the balance
• compute and deposit interest
• permit withdrawal and update the balance
• check for the minimum balance, impose penalty, if necessary, and update the balance.
[10 Marks]






More Question Papers


Exams With Marking Schemes

Popular Exams


Mid Term Exams

End Term 1 Exams

End Term 3 Exams

Opener Exams

Full Set Exams



Return to Question Papers