Saturday 8 September 2012

III Sem SE lab programs


Software Maturity Index
Source Code
#include<iostream.h>
#include<conio.h>
void main()
{
float m,a,c,d,e,smi;
clrscr();
cout<<"\n Enter total  number of modules:";
cin>>m;
cout<<"\n Enter the number of modules added: ";
cin>>a;
cout<<"\n Enter the number of modules changed: ";
cin>>c;
cout<<"\n Enter the number of deleted modules: ";
cin>>d;
e=a+c+d;
smi=(m-e)/m;
cout<<"\n The Software Maturity Index::"<<smi;
if(smi==1)
cout<<"\n The product is stable";
else
cout<<"\n\n The product is unstable";
getch();
}

OUTPUT
Software Maturity Index
-------------------------------

   Enter total number of modules: 940

   Enter the number of modules added: 40

   Enter the number of modules changed: 90

   Enter the number of deleted modules: 12

   The Software Maturity Index: 0.848936

    The product is unstable
                       
                             














CYCLOMATIC  COMPLEXITY
Source Code
#include<iostream.h>
#include<conio.h>
void main()
{
int m,e,n,p=1;
clrscr();
cout<<"\n Cyclomatic Complexity\n";
cout<<"\n --------------------";
cout<<"\n Enter the number of edges::";
cin>>e;
cout<<"\n Enter the number of nodes::";
cin>>n;
m=e-n+2*p;
cout<<"\nThe complexity of the problem::"<<m;
getch();
}

Output
            Cyclomatic Complexity
            -----------------------------
   Enter the number of edges::9

   Enter the number of nodes::8

   The complexity of the problem::3











TYPES OF THE TRAINGLE
Source Code
#include<iostream.h>
#include<conio.h>
void main()
{
int s1,s2,s3;
clrscr();
cout<<"\n\t\tType of the triangle";
cout<<"\n\t\t--------------------";
cout<<"\n\tEnter Sides of the triangle : ";
cin>>s1>>s2>>s3;
if(s1==s2&&s2==s3)
cout<<"\n\tThe Triangle is equilateral";
else if(s1!=s2&&s2!=s3&&s3!=s1)
cout<<"\n\tThe Triangle is Scalene";
else
cout<<"\n\tThe Triangle is Isosceles";
getch();
}

Output

             Type of the triangle
             -------------------------
     Enter Sides of the triangle : 10 10 10
     The Triangle is equilateral






FUNCTIONAL POINT

Source code
#include<iostream.h>
#include<conio.h>
void main()
{int a,b,c,d,e,cost;
float funpoint;
clrscr();
cout<<"Enter the no inputs\n";
cin>>a;
cout<<"Enter the no outputs\n";
cin>>b;
cout<<"Enter the no Queries\n";
cin>>c;
cout<<"Enter the no files\n";
cin>>d;
cout<<"Enter the no interfaces\n";
cin>>e;
cout<<"\nFunctonal point";
cost=(a*6)+(b*5)+(c*4)+(d*7)+(e*10);
funpoint=float(cost)*(0.65+0.01+46);
cout<<funpoint;
getch();
}

OUTPUT

Enter the no inputs 32
Enter the no outputs 60
Enter the no Queries 24
Enter the no files 8
Enter the no interfaces2
Functonal point 30982.240234


COCOMO
Source code:
#include<iostream.h>
#include<conio.h>

void main()
{
int reports,screens,components;
int hop,objectcount,effort;
clrscr();
cout<<"\nEnter the no  reports :";
cin>>reports;
cout<<"\nEnter the no screens :";
cin>>screens;
cout<<"\nEnter the no components";
cin>>components;
int ch;
cout<<"\nComplexity";
cout<<"\n**********\n";
cout<<"1.Simple";
cout<<"\n2.Medium";
cout<<"\n3.Complex";
cout<<"\nEnter ur choice";
cin>>ch;
switch(ch)
{
case 1:objectcount=screens*1+reports*2+components;
break;
case 2:objectcount=screens*2+reports*5+components;
break;
case 3:objectcount=screens*3+reports*8+components;
break;
}
hop=objectcount;
int prod;
cout<<"\nEnter the number of products:";
cin>>prod;
effort=hop/prod;
cout<<"\nEffort :"<<effort;
getch();
}



OUTPUT:

Enter the no  reports : 10
Enter the no screens : 12
Enter the no components: 80
Complexity
**********
1.Simple
2.Medium
3.Complex
Enter ur choice3
Enter the number of products:2
Effort :98








No comments:

Post a Comment