OOSD IIT Kharagpur Mid Sem-12 Question Paper

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Department of Computer Science and Engineering

Mid-Semester Examination

Object-Oriented Systems (CS60059)


Marks: 65

Time:

Number of Students:36

2 hours
Instructions:
o Answer all questions. All answers must be concise. Unnecessarily lengthy
answers and those that exceed any given sentence limit would be penalized.
o No further clarifications on any of the questions shall be given. If you wish, you
can make suitable assumptions regarding a question, but you must clearly write
down your assumptions.

Q. 1 Consider a bank ATM in which a log record needs to be created for every activity that takes place. Based on
this requirement, the following class model was designed. Identify any specific problems that this class model
suffers from. Improve this design based on an appropriate design pattern that you have studied. [4+6 Marks]

Low LevelW
File Recri
te
eip
lo
Operations
tPri

W
W
ri Cas
ri
Cust
tehDi
te
ome
W
W
lo spe
lo
rCon
Net
ri
riCa
g nse
g
sole
wor
rd
te
te
m r
m
Re
lo
lo
e kTo
e ad
Ban
g
g
ss
ss
k
er
m
m
a
a
e
g
ge
ss
e
ess
a
a
g
g
e
e

g
nte
m
re
ss
a
g
e

Q. 2 Consider that a List class that implements the List data structure is already available in the foundation class
library. Suppose you are developing a certain application and need to use a class implementing the Stack data
structure in your design. You have obtained the Stack class by extending the List class as shown below. Identify if
there are any specific problems with your design. Show how to correct the design. [4+6 Marks]
insertTop
insertBottom
(Item)
Li(Item)
removeTop
() ()
removeBottom

s
S
t
a
c
k

Q. 3. Give a Java example to illustrate the fact


satisfactorily in a base class may cease to do so
not overridden in the derived class. Explain

+
p
u
s
h(
I
t
e
m
)
+
p
o
p(
)

Q.4 Assume that in a certain design a method


bind to 5 different methods mb1,, mb5 in
methods mb1,, mb5 can dynamically bind to
is the total number of test cases required to test
in this case? If pair-wise testing is to be
number of test cases that would be required?

Q. 5 Consider that the concrete class


attributes of a 3-dimensional vector (x,y,z). It
calcMag to calculate the magnitude of the
x*x+y*y+z*z. As shown in the following class
vector class FourVector

is realized by

class and an additional attribute t (time) is


is overridden to define the magnitude of the four

that a method that works


in a derived class even when it is
your answer. [ 6 Marks]
ma of a class can dynamically
other classes, and each of the
10 other different methods. What
all possible polymorphic bindings
performed, what is the total
[2+4 Marks]
ThreeVector
stores the
defines several operations such as
three dimensional vector given by
diagram,
a four dimensional
extending

the

ThreeVector

defined and the method calcMag


dimensional vector as t*t-

( x*x+y*y+z*z). The GeomShape class implements the shape interface and aggregates several three dimensional
and four dimensional vectors. Geomshape overrides the placeVec method of Shape class, and invokes the
calcMag of the vectors for vector placements. Identify the specific problems that this design suffers from and
suggest a way to improve it. [4+6 Marks]

Thr
ee
Four
Vec
Vec
tor
tor
x,y,
t:
z:
dou
dou
ble
ble
calc
calc
Mag
Mag
()
()

Geo
Sha
met
pe
Sha
pe
plac
eVe
plac
c()
eVe
c()

Q. 6 For the following software development project, develop the use case model, domain model, and the sequence
diagram for one of the use cases. [9+9+5]
IIT students' Hall Management Center (HMC) has requested us to develop the following software to automate various bookkeeping activities associated with its day to day operations.
After a student takes admission, he/she would present a note from the admission unit to the clerk at HMC, along with a form
filled with his/her name, permanent address, contact telephone number, and a photograph. He/she is then allotted a hall, and also
a specific room number. A letter indicating the allotted room should be printed out to be given to the concerned student.
Students incur mess charges every month depending on the number of meals that they consume over the month. The mess
manager would input to the software the total amount chargeable to each student in a month on mess account.
Each room has a fixed room rent. The rooms are either single-seated or twin-sharing. The newly constructed halls have higher
rent compared to some of the older halls. Twin sharing rooms have lower rent. The HMC chairman enters the room rents for the
different types of rooms. He should also be able to revise the room rents whenever required.
Each hall provides certain amenities to the students such as reading rooms, play rooms, TV room, etc. A fixed amount is levied
on each student on this count. This amount is estimated and entered by the HMC chairman at the beginning of an academic year.
The estimated due from a student towards the residence and mess charges for a semester is computed at the start of the semester,
which the student can see using a web browser. At the end of a semester, the difference between the actual bill amount for the
semester and the paid amount is computed. The balance amount (+ve or Ve) is adjusted in the next semesters dues. The total
amount collected from each student of a hall towards mess charges, and the due amount is handed over to the concerned mess
manager every month. For this, the computer needs to print a sheet indicating the total amount due to each mess manager. Printed
cheques are issued to each manager and their signatures are obtained on the receipt sheet.
The HMC receives an annual grant from the Institute for upkeep of the halls, gardens, and providing certain general amenities to
the students. The HMC chairman should be provided with a functionality that would support distribution of the grant among the
different halls and cheques should be printed based on the grants made to the halls. The Wardens of different halls should be able
to enter their expenditure details against this allocation.
The HMC incurs petty expenses such as repair works carried out, stationery, etc. It should be possible to enter these expenses and
it should be debited from its yearly grants. The HMC chairman should be able to view at any time the statement of accounts .
The HMC chairman would take a print out of the annual consolidated statement of accounts, sign and submit it to the Institute
administration for approval and audit verification.

---The End--3

You might also like