Object Oriented System Development 2018
Object Oriented System Development 2018
com)
UNIVERSITY OF RUHUNA
1)
a) State the four fundamental principles of object oriented design. Briefly explain each
of them.
d) Briefly explain the three basic notations used for modeling concurrency between
activities in activity diagrams.
2) Consider the following class diagram designed for a banking information system. Write a
java code to implement the diagram according to the instructions given below.
c) The method withdraw is used to withdraw a value amount from the account.
e) The method display displays the values of all the attributes of the class including the
inherited ones.
f) The class SavingsAccount has the attribute interestRate that stores the interest rate of
the account.
1 of 4
Kasun Ranga Wijeweera ([email protected])
g) The method addInterest is used to add interest to the available balance of the account
based on the interest rate.
h) The class CheckingAccount has the attribute fee that is charged from the account.
i) The method deductFee is used to reduce the amount fee from the available balance of
the account.
BankAccount
# accountHolder : String
# accountNumber : int
# balance : double
+ BankAccount (accountHolder : String, accountNumber : int)
+ deposit (amount : double) : void
+ withdraw (amount : double) : void
+ getBalance () : double
+ display () : void
SavingsAccount
# interestRate : double
+ SavingsAccount (accountHolder : String, accountNumber : int, interestRate : double)
+ addInterest () : void
+ display () : void
CheckingAccount
- fee : double
+ CheckingAccount (accountHolder : String, accountNumber : int, interestRate : double, fee: double)
+ deductFee () : void
+ display () : void
3) Following requirements are gathered through the requirement analysis process to develop an
online shopping system. Draw a suitable use case diagram considering the given
requirements.
a) Any customer can view the available items. Further, they can search or browse for an
item in order to view. Customer also can add viewed items to a wish list.
c) Any customer can add items to a shopping cart. A user may login to the system in
order to checkout after adding items to the shopping cart.
d) A customer can view recommended items, if he wants, after viewing the available
items.
2 of 4
Kasun Ranga Wijeweera ([email protected])
f) The checkout procedure also involves calculation of taxes and shipping cost.
g) At the end of the checkout procedure, the customer can do the payment either by
using his or her PayPal account or credit card.
4) Following requirements have been gathered through the requirement analysis process for a
bank. Draw a suitable class diagram.
a) The bank is organized as divisions. Some divisions are further divided into
subdivisions.
c) An account belongs to a particular branch and a branch can keep any number of
accounts.
d) Each account has a unique account number. The opening date and the closing date of
the account should be recorded. Further, an account has a balance and an overdraft
limit.
e) A particular account can differ from other accounts by its interest rate and periodic
fee. Furthermore, some accounts may allow issuing cheques. Also insurance facility
is available only for some accounts.
f) There are three types of accounts: mortgage accounts, chequing accounts, and credit
card accounts.
g) A mortgage account has a property: collateral. A credit card account has an expiry
date and a brand.
h) One or more credit cards can be issued for a credit card account with a unique name
for each card.
i) Each division has a set of employees and one of them manages the division.
j) A client can open any number of accounts. However, a single account can be jointly
owned by at most two clients.
3 of 4
Kasun Ranga Wijeweera ([email protected])
5)
a) Draw a class diagram for the following scenario.
b) Draw a class diagram for the following scenario and draw another equivalent class
diagram for the same scenario.
Apex is an educational institute that offers several courses for students. A limited
number of students are allowed to enroll for a course. Furthermore, the student should
have completed certain prerequisite courses from the same institute in order to follow
particular courses. A student with special permission is allowed to enroll for a course
even though he or she has not completed prerequisite courses.
4 of 4