Model Question Papers/Practical

From Amachu
Jump to: navigation, search

Contents

Example 1

  • Propose a use case diagram for an ATM machine for withdrawing cash. Make the use case simple yet informative; only include the major features.
ATM Machine

Example 2

  • Propose a use case diagram for a vending machine that sells beverages and snacks. Make use of inclusion and extension associations, mark multiplicities and remember that a vending machine may need technical assistance from time to time.
Vending Machine Use Case diagram

Example 3

  • Consider the following algorithm for computing the norm of a vector. Write down a sequence diagram that describes the norm() function.
Class Array {
    ...
    public:

      // return the index-th component of the array
      double get(int index);
    ...
};

double norm(const Array& myArray) {
    double theNorm = 0;
    for(int index = 0; index < myArray.size() - 1; index++) {
      theNorm = theNorm + myArray.get(index);
    }
    theNorm = sqrt(theNorm);
    return theNorm;
Norm of a Vector

Example 4

  • Write a sequence diagram for a program that displays the following figure on the screen in the order left → right.
Print shapes
Sequence diagram Printing of drawing

Example 5

  • Draw a class diagram for the single class Complex. A Complex object has a private real and an imaginary part (of type double), and can perform addition, subtraction, multiplication and division by another complex number.
Class diagram Complex numbers

Example 6

  • Create a page: state_capital_cm_list_india in mediawiki that has the following contents. The heading, boldness, cell alignments need to appear as you see below.
    Mediawiki Table
= State, Chief ministers, Capital =
{| class="wikitable"
!align="center"|State
!Chief Minister
!Capital
|-
|Tamilnadu
|Jayalalitha
|Chennai
|-
|Gujrat
|Narendramodi
|Gandhinagar
|-
|Bihar
|Nitish Kumar
|Patna
|-
|Karnataka
|Jagdish Shettar
|Bangalore
|}

Example 7

  • Create a page: mscfoss in mediawiki, that has the following contents. The heading, boldness, hyper-links need to appear as you see below.
    Mediawiki Text Processing
= M Sc (CS-FOSS) Online Program =

Two Year M. Sc. (Computer Science – Free/Open Source Software) of Anna University Chennai is unique in many ways -

* It is the only degree-oriented program of a leading Indian technological university focused sharply on Free/Open Source Software (FOSS) that has
revolutionised the field of computing the world over. In the process of becoming a CS Professional through this program, one also acquires mastery
over a wide range of products, tools, technologies and approaches thrown up by the FOSS movement that dominate the global SW/IT Industry today.
* It is the only such program of a leading Indian technological university delivered entirely Online with its well recognised benefits of flexible
interactivelearning unconstrained by geographical limitations, suited especially for working people.

As a member of the nationally coordinated [http://nrcfoss.au-kbc.org.in/ NRCFOSS Project] of the Dept. of Inf. Tech., Govt. Of India, Anna Univer-
sity has been pioneering introduction of FOSS in Higher Education in the country through its AU-KBC Research Centre. The M Sc (CS-FOSS) Program 
is built on this rich experience and expertise, with the [http://au-kbc.org/ AU-KBC Research] Centre serving as its Coordinating Centre.

Example 8

  • Do the following, using sample1.txt & sample2.txt given below.
    • Content diff
      • Create a context diff with name, context.patch between sample1.txt & sample2.txt
      • Make copy of sample1.txt to sample1.orig.txt
      • Apply the patch created on sample1.txt
      • Documents the steps followed.
    • Unified diff
      • Create a unified diff with name, unified.patch between sample1.txt & sample2.txt
      • Make copy of sample1.txt to sample1.orig.txt
      • Apply the patch created on sample1.txt
      • Document the steps followed.

Use the text below as sample1.txt

     The Way that can be told of is not the eternal Way;
     The name that can be named is not the eternal name.
     The Nameless is the origin of Heaven and Earth;
     The Named is the mother of all things.
     Therefore let there always be non-being,
       so we may see their subtlety,
     And let there always be being,
       so we may see their outcome.
     The two are the same,
     But after they are produced,
       they have different names.

Use the text below as sample2.txt

     The Nameless is the origin of Heaven and Earth;
       The named is the mother of all things.
     
     Therefore let there always be non-being,
       so we may see their subtlety,
     And let there always be being,
       so we may see their outcome.
     The two are the same,
     But after they are produced,
       they have different names.
     They both may be called deep and profound.
     Deeper and more profound,
     The door of all subtleties!

Context diff

  • $ diff -c sample1.txt sample2.txt > context.patch
  • $ cp sample1.txt sample1.orig.txt
  • $ patch sample1.txt < context.patch
     *** sample1.txt 2002-02-21 23:30:39.942229878 -0800
     --- sample2.txt 2002-02-21 23:30:50.442260588 -0800
     ***************
     *** 1,7 ****
     - The Way that can be told of is not the eternal Way;
     - The name that can be named is not the eternal name.
       The Nameless is the origin of Heaven and Earth;
     ! The Named is the mother of all things.
       Therefore let there always be non-being,
         so we may see their subtlety,
       And let there always be being,
     --- 1,6 ----
       The Nameless is the origin of Heaven and Earth;
     ! The named is the mother of all things.
     ! 
       Therefore let there always be non-being,
         so we may see their subtlety,
       And let there always be being,
     ***************
     *** 9,11 ****
     --- 8,13 ----
       The two are the same,
       But after they are produced,
         they have different names.
     + They both may be called deep and profound.
     + Deeper and more profound,
     + The door of all subtleties!

Unified diff

  • $ diff -u sample1.txt sample2.txt > unified.patch
  • $ cp sample1.txt sample1.orig.txt
  • $ patch sample1.txt < unified.patch
     --- sample1.txt	2002-02-21 23:30:39.942229878 -0800
     +++ sample2.txt	2002-02-21 23:30:50.442260588 -0800
     @@ -1,7 +1,6 @@
     -The Way that can be told of is not the eternal Way;
     -The name that can be named is not the eternal name.
      The Nameless is the origin of Heaven and Earth;
     -The Named is the mother of all things.
     +The named is the mother of all things.
     +
      Therefore let there always be non-being,
        so we may see their subtlety,
      And let there always be being,
     @@ -9,3 +8,6 @@
      The two are the same,
      But after they are produced,
        they have different names.
     +They both may be called deep and profound.
     +Deeper and more profound,
     +The door of all subtleties!
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox
Print/export