Following are some of the main advantages of Use Case Modeling:
1. The use case diagram provides a comprehensive summary of the whole software system in a single illustration.
2. The use cases are mainly composed of narrative text. Hence, unlike many other modeling techniques, the non technical stake holders (e.g. customers, end users, salesperson etc) are also able understand the model for the software system. This means that feedback can be obtained at a very early stage of the development from the customers and the end users.
3. Another major advantage of use case modeling is that it requires the identification of exceptional scenarios for the use cases. This helps in discovering subtle alternate requirements in the system.
4. The use case model can be utilized in several other aspect of software development as well, e.g. Cost Estimation, Project Planning, Test Case Preparation and User Documentation.
Click below link to see Use Case Diagram
Click below link to see Use Case Diagram
#include <stdio.h>
#include <conio.h>
#include <alloc.h>
#define MAX1 3
#define MAX2 3
#define MAXSIZE 20
#define TRUE 1
#define FALSE 2
struct sparse
{
int *sp ;
int row ;
int *result ;
} ;
void initsparse ( struct sparse * ) ;
void create_array ( struct sparse * ) ;
int count ( struct sparse ) ;
void display ( struct sparse ) ;
void create_tuple ( struct sparse*, struct sparse ) ;
void display_tuple ( struct sparse ) ;
void prodmat ( struct sparse *, struct sparse, struct sparse ) ;
void searchina ( int *sp, int ii, int*p, int*flag ) ;
void searchinb ( int *sp, int jj, int colofa, int*p, int*flag ) ;
void display_result ( struct sparse ) ;
void delsparse ( struct sparse * ) ;
void main( )
{
struct sparse s[5] ;
int i ;
clrscr( ) ;
for ( i = 0 ; i <= 3 ; i++ )
initsparse ( &s[i] ) ;
create_array ( &s[0] ) ;
create_tuple ( &s[1], s[0] ) ;
display_tuple ( s[1] ) ;
create_array ( &s[2] ) ;
create_tuple ( &s[3], s[2] ) ;
display_tuple ( s[3] ) ;
prodmat ( &s[4], s[1], s[3] ) ;
printf ( "\nResult of multiplication of two matrices: " ) ;
display_result ( s[4] ) ;
for ( i = 0 ; i <= 3 ; i++ )
delsparse ( &s[i] ) ;
getch( ) ;
}
/* initialises elements of structure */
void initsparse ( struct sparse *p )
{
p -> sp = NULL ;
p -> result = NULL ;
}
/* dynamically creates the matrix */
void create_array ( struct sparse *p )
{
int n, i ;
/* allocate memory */
p -> sp = ( int * ) malloc ( MAX1 * MAX2 * sizeof ( int ) ) ;
/* add elements to the array */
for ( i = 0 ; i < MAX1 * MAX2 ; i++ )
{
printf ( "Enter element no. %d: ", i ) ;
scanf ( "%d", &n ) ;
* ( p -> sp + i ) = n ;
}
}
/* displays the contents of the matrix */
void display ( struct sparse s )
{
int i ;
/* traverses the entire matrix */
for ( i = 0 ; i < MAX1 * MAX2 ; i++ )
{
/* positions the cursor to the new line for every new row */
if ( i % 3 == 0 )
printf ( "\n" ) ;
printf ( "%d\t", * ( s.sp + i ) ) ;
}
}
/* counts the number of non-zero elements */
int count ( struct sparse s )
{
int cnt = 0, i ;
for ( i = 0 ; i < MAX1 * MAX2 ; i++ )
{
if ( * ( s.sp + i ) != 0 )
cnt++ ;
}
return cnt ;
}
/* creates an array that stores information about non-zero elements */
void create_tuple ( struct sparse *p, struct sparse s )
{
int r = 0 , c = -1, l = -1, i ;
/* get the total number of non-zero elements */
p -> row = count ( s ) + 1 ;
/* allocate memory */
p -> sp = ( int * ) malloc ( p -> row * 3 * sizeof ( int ) ) ;
/* store information about
total no. of rows, cols, and non-zero values */
* ( p -> sp + 0 ) = MAX1 ;
* ( p -> sp + 1 ) = MAX2 ;
* ( p -> sp + 2 ) = p -> row - 1 ;
l = 2 ;
/* scan the array and store info. about non-zero values
in the 3-tuple */
for ( i = 0 ; i < MAX1 * MAX2 ; i++ )
{
c++ ;
/* sets the row and column values */
if ( ( ( i % 3 ) == 0 ) && ( i != 0 ) )
{
r++ ;
c = 0 ;
}
/* checks for non-zero element,
row, column and non-zero value
is assigned to the matrix */
if ( * ( s.sp + i ) != 0 )
{
l++ ;
* ( p -> sp + l ) = r ;
l++ ;
* ( p -> sp + l ) = c ;
l++ ;
* ( p -> sp + l ) = * ( s.sp + i ) ;
}
}
}
/* displays the contents of the matrix */
void display_tuple ( struct sparse s )
{
int i, j ;
/* traverses the entire matrix */
printf ( "\nElements in a 3-tuple: " ) ;
j = ( * ( s.sp + 2 ) * 3 ) + 3 ;
for ( i = 0 ; i < j ; i++ )
{
/* positions the cursor to the new line for every new row */
if ( i % 3 == 0 )
printf ( "\n" ) ;
printf ( "%d\t", * ( s.sp + i ) ) ;
}
printf ( "\n" ) ;
}
/* performs multiplication of sparse matrices */
void prodmat ( struct sparse *p, struct sparse a, struct sparse b )
{
int sum, k, position, posi, flaga, flagb, i , j ;
k = 1 ;
p -> result = ( int * ) malloc ( MAXSIZE * 3 * sizeof ( int ) ) ;
for ( i = 0 ; i < * ( a.sp + 0 * 3 + 0 ) ; i++ )
{
for ( j = 0 ; j < * ( b.sp + 0 * 3 + 1 ) ; j++ )
{
/* search if an element present at ith row */
searchina ( a.sp, i, &position, &flaga ) ;
if ( flaga == TRUE )
{
sum = 0 ;
/* run loop till there are element at ith row
in first 3-tuple */
while ( * ( a.sp + position * 3 + 0 ) == i )
{
/* search if an element present at ith col.
in second 3-tuple */
searchinb ( b.sp, j, * ( a.sp + position * 3 + 1 ),
&posi, &flagb ) ;
/* if found then multiply */
if ( flagb == TRUE )
sum = sum + * ( a.sp + position * 3 + 2 ) *
* ( b.sp + posi * 3 + 2 ) ;
position = position + 1 ;
}
/* add result */
if ( sum != 0 )
{
* ( p -> result + k * 3 + 0 ) = i ;
* ( p -> result + k * 3 + 1 ) = j ;
* ( p -> result + k * 3 + 2 ) = sum ;
k = k + 1 ;
}
}
}
}
/* add total no. of rows, cols and non-zero values */
* ( p -> result + 0 * 3 + 0 ) = * ( a.sp + 0 * 3 + 0 ) ;
* ( p -> result + 0 * 3 + 1 ) = * ( b.sp + 0 * 3 + 1 ) ;
* ( p -> result + 0 * 3 + 2 ) = k - 1 ;
}
/* searches if an element present at iith row */
void searchina ( int *sp, int ii, int *p, int *flag )
{
int j ;
*flag = FALSE ;
for ( j = 1 ; j <= * ( sp + 0 * 3 + 2 ) ; j++ )
{
if ( * ( sp + j * 3 + 0 ) == ii )
{
*p = j ;
*flag = TRUE ;
return ;
}
}
}
/* searches if an element where col. of first 3-tuple
is equal to row of second 3-tuple */
void searchinb ( int *sp, int jj, int colofa, int *p, int *flag )
{
int j ;
*flag = FALSE ;
for ( j = 1 ; j <= * ( sp + 0 * 3 + 2 ) ; j++ )
{
if ( * ( sp + j * 3 + 1 ) == jj && * ( sp + j * 3 + 0 ) == colofa )
{
*p = j ;
*flag = TRUE ;
return ;
}
}
}
/* displays the contents of the matrix */
void display_result ( struct sparse s )
{
int i ;
/* traverses the entire matrix */
for ( i = 0 ; i < ( * ( s.result + 0 + 2 ) + 1 ) * 3 ; i++ )
{
/* positions the cursor to the new line for every new row */
if ( i % 3 == 0 )
printf ( "\n" ) ;
printf ( "%d\t", * ( s.result + i ) ) ;
}
}
/* deallocates memory */
void delsparse ( struct sparse *s )
{
if ( s -> sp != NULL )
free ( s -> sp ) ;
if ( s -> result != NULL )
free ( s -> result ) ;
}
Components of capital Analysis
The capital budgeting process is a measurable way for businesses to determine the long-term economic and financial profitability of any investment project.
Capital budgeting is also vital to a business because it creates a structured step by step process that enables a company to:
Capital budgeting is also vital to a business because it creates a structured step by step process that enables a company to:
- Develop and formulate long-term strategic goals – the ability to set long-term goals is essential to the growth and prosperity of any business. The ability to appraise/value investment projects via capital budgeting creates a framework for businesses to plan out future long-term direction.
- Seek out new investment projects – knowing how to evaluate investment projects gives a business the model to seek and evaluate new projects, an important function for all businesses as they seek to compete and profit in their industry.
- Estimate and forecast future cash flows – future cash flows are what create value for businesses overtime. Capital budgeting enables executives to take a potential project and estimate its future cash flows, which then helps determine if such a project should be accepted.
- Facilitate the transfer of information – from the time that a project starts off as an idea to the time it is accepted or rejected, numerous decisions have to be made at various levels of authority. The capital budgeting process facilitates the transfer of information to the appropriate decision makers within a company.
- Monitoring and Control of Expenditures – by definition a budget carefully identifies the necessary expenditures and R&D required for an investment project. Since a good project can turn bad if expenditures aren't carefully controlled or monitored, this step is a crucial benefit of the capital budgeting process.
- Creation of Decision – when a capital budgeting process is in place, a company is then able to create a set of decision rules that can categorize which projects are acceptable and which projects are unacceptable. The result is a more efficiently run business that is better equipped to quickly ascertain whether or not to proceed further with a project or shut it down early in the process, thereby saving a company both time and money.
Difference between IRR and NPV Methods
Key differences between the most popular methods, the NPV (Net Present Value) Method and IRR (Internal Rate of Return) Method, include:
• NPV is calculated in terms of currency while IRR is expressed in terms of the percentage return a firm expects the capital project to return;
• Academic evidence suggests that the NPV Method is preferred over other methods since it calculates additional wealth and the IRR Method does not;
• The IRR Method cannot be used to evaluate projects where there are changing cash flows (e.g., an initial outflow followed by in-flows and a later out-flow, such as may be required in the case of land reclamation by a mining firm);
• However, the IRR Method does have one significant advantage — managers tend to better understand the concept of returns stated in percentages and find it easy to compare to the required cost of capital; and, finally,
• While both the NPV Method and the IRR Method are both DCF models and can even reach similar conclusions about a single project, the use of the IRR Method can lead to the belief that a smaller project with a shorter life and earlier cash inflows, is preferable to a larger project that will generate more cash.
• Applying NPV using different discount rates will result in different recommendations. The IRR method always gives the same recommendation.
Generalization
Generalization is a mechanism for combining similar classes of objects into a single, more general class. Generalization is a bottom-up process. Generalization and inheritance are powerful abstractions for sharing similarities among classes while preserving their differences.Some Forms of Generalization
1. Hierarchy: In the case of hierarchy, the commonalities are organized into a tree structured form. At the root of any subtree are found all the attributes and behavior common to all of the descendents of that root.2. Genericity: In this case, the commonality is expressed with the aid of a parameter. Various specializations are distinguished by what they provide for the parameter. For example, using genericity it is possible to represent the common properties of a "stack" through the generalization of a "stack of anything", where "anything" represents the parameter.
3. Polymorphism: Polymorphism captures commonality in algorithms. Polymorphism allows the nested logic (or case statement) to be collapsed to a single case in which the different object types are treated in a uniform manner.
4. Patterns: A pattern expresses a general solution (the key components and relationships) to a commonly occurring design problem. The attributes and behavior of the individual components are only partially defined to allow the pattern to be interpreted and applied to a wide range of situations.
Inheritance
The generalization/specialization relationship is implemented in object-oriented programming languages with inheritance. Inheritance is the implementation mechanism for the generalization/specialization relationship. In single inheritance a subclass has only one superclass. In multiple inheritance a subclass has two or more superclasses.One object-oriented concept that helps objects work together is inheritance. Inheritance defines relationships among classes in an object-oriented language. In other words, Inheritance is the mechanism used in object-oriented programming (OOP) languages to permit a subclass to share attributes and operations defined in the superclasses.
For example the subclass Car can share the attributes and operations from the superclass Vehicle. The subclass Car may add attributes and operations.
The inefficient but correct analysis model can be optimized to make implementation
more efficient. To optimize the design, the following things should be done:
1. Adding Redundant Associations for Efficient Access
Redundant associations do not add any information, thus during design we should actually examine the structure of object model for implementation, and try to establish whether we can optimize critical parts of the completed system. Can new associations be added, or old associations be removed? The derived association need not to add any information to the network, they help increasing the model information in efficient manner.
We can analyze the use of paths in the association network as follows:
- Evaluate each operation
- Find associations that it must pass through to get information. Associations can be bi-directional (generally by more than one operation), or unidirectional, which can be implemented as pointers.
For each operation, we should know the followings:
- How frequently is the operation needed, and how much will it cost?
- What is the fan-out along a path through the network? To find fan-out of the complete path, multiply the average count of each “many” associations found in the path with individual fan-outs.
- What are the objects that satisfy the selection criteria (if specified) and are operated on? When most of the objects are rejected during traversal for some reason, then a simple nested loop may be inefficient at finding target objects.
2. Rearranging the Execution Order for Efficiency
As we already know algorithm and data structure are closely related to each other, but data structure is considered as the smallest but very important part of algorithm.
Thus, after optimizing the data structure, we try to optimize the algorithm itself. In general, algorithm optimization is achieved by removing dead paths as early as possible. For this, we sometimes reverse the execution order of the loop from the original functional model.

