Case Study cont - PowerPoint PPT Presentation

1 / 38
About This Presentation
Title:

Case Study cont

Description:

... objects with common properties (attributes), common behavior ... out an object's properties and ... C ob; OUPUT : In Constructor A. In Constructor B. In ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 39
Provided by: institutet1
Category:
Tags: case | cont | property | study

less

Transcript and Presenter's Notes

Title: Case Study cont


1
Case Study cont
  • Loan Process
  • Librarian will check for overdue books
  • Librarian will check for over limit.
  • Check status of each copy. (reference or
    borrowable)
  • Librarian can choose to accept or cancel the
    request for a loan.
  • If the loan is accepted, the librarian keeps all
    the loan details.

2
Case Study cont
  • Return Process
  • The librarian accepts the return and checks the
    status of the copy. (ie. Referenced or
    Borrowable)
  • If the copy is already reserved,
  • the librarian inform the member who has
    reserved the copy

3
Case Study cont
  • Reservation Process
  • Librarian accepts the reservation depending on
    the status of the copies.
  • If the reservation is accepted, the librarian
    keeps all the reservation details.

4
Case Study cont
  • Inquiry Process
  • The Librarian can handle inquiries from the
    borrower about the availability of a book.
  • Registered visitors/Borrowers also can check the
    availability of a book.

5
Case Study cont
  • Registration Process
  • There are two kinds of registration
  • Book Registration
  • User Registration

6
Case Study cont
  • Report Process
  • There are two kinds of reports
  • Overdue Report
  • Management Report

7
Model Structured Question Paper
  • Q1 of Model Structured Question Paper is based on
    the model Case Study.
  • Questions are based on a Use Case diagram and a
    Class diagram.

8
Model Structured Question Paper Q1
  • Identify the Actors for the Library system.
  • Definition of an Actor
  • Represents anyone or any thing that must
    interact with the system
  • Librarian
  • Registered User, Borrower

9
Model Structured Question Paper Q1 cont..
  • Identify the Use Cases for the Library system.
  • Definition of a Use Case
  • It is a typical interaction between a user and
    a computer system.

10
Model Structured Question Paper Q1 cont..
  • How to capture Use Cases?
  • By talking to typical users (Actors) and
    discussing things that they might want to do with
    the system.

11
Model Structured Question Paper Q1 cont..
  • Librarian handles the following use cases
  • Loan Process, Return Process, Reservation
    Process, Inquiry Process, Report Process, Book
    Registration Process, and User Registration
    Process.
  • Registered User/Borrower handles the following
    use case
  • Check item available

12
Q1 (a) Following is a Use Case diagram for the
above system. Identify the Actors/Use Cases for
labels A-H.
13
A Reservation/Returning
B- Returning/Reservation
H-Librarian
C Book Registration
G-Registered User
D-Registration
E- Overdue Report
F-Reports
14
Q1 (b) Identify the potential Classes for the
above system.
  • Definition of a Class
  • A Class is description of group of objects with
    common properties (attributes), common behavior
    (operations), common relationships to other
    objects, and common semantics.

15
  • What kinds of things are classes?
  • Objects and their divisions in to classes
    often derive from one of the following sources.
  • Tangible or Real World things Book, Copy etc.
  • Roles Library Member, Student etc.
  • Events Reservation, Arrival
  • Interactions Meetings.

16
Q1 (b) Identify the potential Classes for the
above system cont..
  • To ease the process, Identify the nouns and noun
    phrases in the Case Study (Attributes, Classes,
    etc)
  • Discard candidates which are inappropriate for
    any reason.
  • eg. Library
  • Member and Borrower are the same

17
  • Possible candidates for classes

Reference Copy
Library
Borrowed Copy
Book
Borrower
Loan Details
Member
Reserved Copy
Overdue Report
Registered Visitor
Copy
Borrowable Copy
18
Q1 (b) Identify the potential Classes for
the above system cont..
  • Classes Book, Copy, Borrower, Borrowed Copy,
    Reserved Copy
  • Attributes Book title, NIC no, etc.

19
(c) Identify the static relationships between the
above classes.
  • Types of relationships that exist between
    classes/objects.
  • Association (Instance Connection)
  • Aggregation
  • Generalization (Inheritance)

20
(c) Identify the static relationships between the
above classes cont..
21
(d) Identify the object(s) responsible for the
Use Case C in (a).
  • Use Case C is Book Registration

22
  • Q4) A Class Counter is to be created to
    allow the display of the count. It should be able
    to increment by one, decrement by one, reset to
    zero and display the count. When the object is
    declared the counter must be initialized to zero.

23
(i) Write down the C definition for the class
counter. (method implementation is not needed)
class counter int
count public
counter() void
increment() void decrement() void
reset() void display()
24
(ii) Implement the methods using C.
countercounter
count0
void counterdecrement()
count--
void counterreset()
count0
void counterincrement()
count
25
void counterdisplay()
coutltltcountltltcount
  • (iii) Use function overloading to increment or
    decrement the counter by a given value. Write
    down the implementation code for the new
    functions.

void counter increment(int x)
countx

void counter decrement(int x)
count-x

26
  • (iv) Fill in the blanks in the following
    main() function.

void main() //create an object called
MyCounter //increment MyCounter
count by 6 //Display the MyCounter count
//Reset the MyCounter Count
counter MyCounter
MyCounter.increment(6)
MyCounter.display()
MyCounter.reset()
27
  • (v) Overload the constructor so that when an
    object MyC2(5) is created, counter will be
    initialized to 5. Write down the implementation
    code for the new function.

counter(int x)
countx
28
Q3 (c) The following is a Class Toolbar drawn
using UML notations
Attributes
                 
protected
Services
public
private
Identify the attributes, services and their
visibility.
29
(d) Write down four UML diagrams that give a
static view of a system.
  • Class, Object, Component, and Deployment
    Diagrams
  •   
  • Behavioural diagrams are used to visualize,
    specify, construct and document the dynamic
    aspects of a system.
  • Use Case, Sequence , Collaboration ,
    Statechart , and Activity diagrams
  •  

30
Q2 (a) Given below are statements associated
with Object Oriented concepts. You are required
to match the statements in Column A with those in
Column B.
  • Column A
  • Abstraction means, simply
  • (B) Polymorphism specifies
  • (C) Object encapsulates
  • (D) Objects use other objects services

31
  • Column B
  • that an operation can have the same name in
    different classes, and each class will perform
    the operation in a specific way.
  • (ii) dynamic behaviour in the real world.
  • (iii) to filter out an objects properties and
  • operations, until just the ones one needs
    are left.
  • (iv) what they do. That is, they hide the inner
  • workings of their operations from the
    outside world and from other objects.
  • (v) via collaborations.
  • (vi) through message Interactions

32
(A) Abstraction
  • (iii) to filter out an objects properties and
  • operations, until just the ones one needs are
    left.

(B) Polymorphism specifies
(i) that an operation can have the same name in
different classes, and each class will perform
the operation in a specific way.
33
(C) Object encapsulates
  • (iv) what they do. That is, they hide the inner
    workings of their operations from the outside
    world and from other objects.

(D) Objects use other objects services
(vi) through message Interactions
34
Q2.(b) What would be the output of the following
program? include ltiostream.hgt class A public
A() coutltltIn Constructor A\n
A()coutltltIn Destructor A ) class B
public B()coutltltIn Constructor B \n
B()coutltltIn Destructor B  class C
public A, public B public C() coutltltIn
Constructor C\n C()coutltltIn Destructor C
 
35
  • void main()
  • C ob

36
  • OUPUT
  • In Constructor A
  • In Constructor B
  • In Constructor C
  • In Destructor C In Destructor B
  • In
    Destructor A

37
(c)   What would be the output when the main()
function is modified as given below.   void
main() C ob1,ob2   Output
38
  • OUPUT
  • In Constructor A
  • In Constructor B
  • In Constructor C
  • In Constructor A
  • In Constructor B
  • In Constructor C
  • In Destructor C In Destructor B In Destructor A
  • In Destructor C In Destructor B In Destructor A
Write a Comment
User Comments (0)
About PowerShow.com