UML Solution Second Internal Exam

Embed Size (px)

Citation preview

  • 7/28/2019 UML Solution Second Internal Exam

    1/11

    UML - Secomd Internal Paper Solution 2012 (March)

    Q-1: Attempt following queastions. (Attempt any 3) [6]

    a. Simplify, State diagrams by using subdiagrams with example.Ans.

    A state is a condition during the life of an object during which it satisfies some condition, performs

    some activity, or waits for some external event. A substate is a state that is nested in another state.

    Substates may be nested to any level.

    (a) Vending Machine State diagram.

    (b) Despemse Item- Submachine or Subdiagram of vending machine.

    In (a) initialy a cending machine is idle. When a person inserts coins, the machine adds the

    amount to the balance and validate some conditions, then person select an item.

    If item is not available or balance is insufficient than machine waits for another selection.

    Otherwise machine dispenses the item and perform changes.

    In (b) Nested state of vending machine is defined as DispenseItem. It also called a

    submachine. A submachine is a state diagram that invoked as a part of another state diagram.

  • 7/28/2019 UML Solution Second Internal Exam

    2/11

    OR You can also draw this diagram

    If a transition is from a substate within the composite state, any exit action for the substate is executed

    followed by any exit action for the enclosing composite state.

    A transition from the composite state may occur from any of the substates and takes precedence over any

    of the transitions for the current substate.

    b. What is Concurrency? Explain following. Aggregation concurrency.

    Concurrency within an object.

    Ans.

    A concurrency is when two or more operations are performed simultaneously within a computer. These

    processes typically are independent of one another. The state model implicitly supports concurrency

    among objects. Objects are autonomous entities that change independently of one another.

    Aggregation concurrency.

    An assembly is a collection of state diagrams, its aggreagation is combined states of all the parts.

    Aggreagation is and-relationship. The aggreagate state is one state from the first diagram, and

    second from other diagram and so on.

  • 7/28/2019 UML Solution Second Internal Exam

    3/11

    Example:

    A Car as an aggreagation of parts states.

    Here a Car shows the different states like Ignition, Transmission, Accelerator and Brake.

    Each parts of the car undergoes transitions in parallel with all others. Car will start moving when

    when upshift from neutral to first.

    Concurrency within an Object

    Concurrency within the state of single object occurs when this object can be partitioned into

    subsets of attributes or links. Each have their own subdiagram.

    The state of the object include one state from each subdiagram.

    The UML show consurrency within an object by partitioning the composite state into dotted

    region. Define name of the composite state in a separate tab.

  • 7/28/2019 UML Solution Second Internal Exam

    4/11

    Example-1:

    In the given example final state is decomposed into two concurrent substates, Hardware

    and Software test, separating them with dotted line.

    Each of these concurrent substates (test ports and test modules) decomposed into

    sequential substates. When control passes from installation state to final state it forks to two concurrent flows

    Hardware nad software test.

    Example-2:

    Sometimes it is necessary to model several independent abstractions of attribute values.

    For example, an undergraduate students have to complete both final year project and core

    subjects before he/she can be graduate.

    c. What do you mean by Software Development Life Cycle (SDLC)? What are the phases (stages)of it?

    Ans.

    A software development process (SDLC) provide a basis for production of software, using

    predefined techniques and notations.

    SDLC (Water Fall Model) can be represent given as below,

  • 7/28/2019 UML Solution Second Internal Exam

    5/11

    OR

    Here developers first get the requirements, then follow the design phase with analysis and System

    design, Then prepare class design (coding) , then testing of application and at last deployment.

    Each phase must be complete before next phase is begun. This model works well only after

    completion of all stages successfully.

    Most of the organizations follow the waterfall approach when huge requirement of application is

    there.

    Phases:

    System conception: Get an idea and gather requirements about an application . Analysis: It specify What must be done not how it should be done . Understanding of

    requirements by constructing a model.

    System Design:Define architecture, choose global strategies(planning) and principles for class

    design.

    Class-Design: Create real-world models for computer implementation. Define algorithms for

    operations.

    Implementaion: Translate the design into programming code and database structure.

    Testing: Check whether the developed application is able for actual use and satisfy the

    requirements.

    Training: Help users to learn this new application

    Deployment: Keep the application for use by general users.

    Maintenance: Provide solution of problems, Upgradation of application, improve performance

    etc..

    d. Explain term Swimlanes with example.Ans.

    There are different departments are available in an organizations such as Sales, finance,

    marketing, purchase etc.

    When design of system completed, the activity will be assigned to each person. At complex level these activites will be partitioned among organizations.

    Activity diagram will be divide into columns and lines. Each column is calledswimlane.

    Placing an activity into the swimlane indicates that it is performed by a person.

    Swimlane boundaries indicate interaction amongs different organozations.

    Here the example of an airoplane is given, The flight attendants must clean the trash, the ground

    crew must add fuel, and catering provide service for food and drink.

  • 7/28/2019 UML Solution Second Internal Exam

    6/11

    Activity Diagrams with swimlanes

    Q-2: Draw State and Use Case diagram for Restaurant System [3]

    Sitting in resturant

    decide order

    Give order

    Wait

    Eating

    Ask for other order by waiter

    Provide Bill

    Pay bill and tip

    exit

    vacancy

    provide menu

    wait for food

    no vacancy

    State Diagram For Resturant

  • 7/28/2019 UML Solution Second Internal Exam

    7/11

    OR

    Q-2: Draw the use-case diagram for Hotel Information System. There are two types of

    customers: Tour-group customers and Individual customers. Both can book, cancel,

    check-in and check-out of a room by Phone or via the Internet. There are booking

    process clerk and reception staff who manages it. A customer can pay his bill by creditcard or pay utility bill.

    Ans.

    In this example, consider a simple hotel information system for two groups of customers: TourGroup customers and Individual customers. Tour Group customers are those who have made

    advanced reservations through a tour operator, while Individual customers make theirreservations directly with the hotel. Both groups of customers can book, cancel, check-in and

    check-out of a room by phone or via the Internet.

    Based on these requirements, there are four observable services as use cases: Make Booking,Cancel Booking, Check-in a Room and Check-out a Room.

    Figure shows the use case model for this simple hotel information system.

  • 7/28/2019 UML Solution Second Internal Exam

    8/11

    Q-3: Write down Scenario and Draw Activity diagram for Stock Broker System. [3]

    Ans.

    Scenario:

    User Log-in.System establishes secure communication.

    System display portfolio information.User order for 200 shares of Elicon at the market price.

    System verifies sufficient funds for purchase.System displays confirmation screen with estimated cost.

    User confirms purchase.System places order on securities exchange.

    System displays transaction tracking number.

    User Logs-out.System establishes insecure communication.

    system displays Good Bye screen.

    Securities exchange reports results of trade.Activity Diagram:

  • 7/28/2019 UML Solution Second Internal Exam

    9/11

    OR

    Q-3: Prepare an activity diagram for computing a restaurant bill. There should be a charge

    for each delivered item. The total amount should be subject to tax and a service charge of 18%

    for groups of six of more. For smaller groups, there should be a blank entry for a gratuity

    according to the customers discretion. Any coupons or gift certificates submitted by thecustomer should be subtracted.

  • 7/28/2019 UML Solution Second Internal Exam

    10/11

    Q-4: Draw a sequence diagram for Railway Reservation System. [3]

    Steps : 1.Train Inquiry 2. Issue ticket 3. Payment 4. Cancel

  • 7/28/2019 UML Solution Second Internal Exam

    11/11

    OR

    Q-4: Exaplain the use of include and extends relationships in use-case diagram?

    Draw the use- case diagram for Online Admission Process for Engineering Students in

    Gujarat.

    Ans.

    For include and extends relationships chapter-8

    Online Admission

    Process