Anda di halaman 1dari 18

# SOURCE CODE

## /**********METRICS & MEASUREMENT**********/

# include<graphics.h>
# include<stdlib.h>
# include<iostream.h>
# include<math.h>
# include<conio.h>
# include<process.h>
# include<stdio.h>

/**************FUNCTIONS USED*************/

void fp();
void maintain();
float lg(float);
void hal();
void d3();
void measure();
void measure()
{
int a;
clrscr();
gotoxy(32,4);
cprintf("METRICS FOR ANALYSIS MODEL");
textcolor(GREEN);
gotoxy(32,5);
cprintf("_________________________");
textcolor(WHITE);
gotoxy(27,10);
cprintf("1.Function Point Metrics");
gotoxy(27,12);
cprintf("2.3D Function Point Metrics");
gotoxy(27,14);
gotoxy(27,16);
cin>>a;

switch(a)
{
case 1: fp();
break;

case 2: d3();
break;

break;

default:
measure();
}

getch();
}
/*************FUNCTION POINT*************/

void fp()
{ int fi=0,w,x,y,z,z2,ct;
float caf,fp;
int a[5];
int b[14];

clrscr();
QUESTIONS:-";
cout<<"\n\n\n1.How many inputs does your system
require? \n Many(7-9) Average(3-6) Few(0-2) : ";
cin>>a[0];
cout<<"\n\n2.How many outputs will the system
produce? \n Many(7-9) Average(3-6) Few(0-2) : ";
cin>>a[1];
cout<<"\n\n3.How many users inquires does your system
entertain ? \n Many(7-9) Average(3-6) Few(0-2) : ";
cin>>a[2];
cout<<"\n\n4.How many files does the system require? \n
Many(7-9) Average(3-6) Few(0-2) : ";
cin>>a[3];
cout<<"\n\n5.How many external interface does your
system require?\n Many(7-9) Average(3-6) Few(0-2) :";
cin>>a[4];
getch();

clrscr();
QUESTIONS TO CALCULATE THE C.A.F";
cout<<"\n\n1.Does your system require backup and
recovery?Intesively(5) \nMorderately (2) Lightly(0)";
cin>>b[0];
cout<<"\n\n2.How much data communicaton are
required?Much(5) Average(2) Less(0)";
cin>>b[1];
cout<<"\n\n3.Are there distributed process function?
Many(5) Average(2) Few(0)";
cin>>b[2];
cout<<"\n\n4.How critical is the performance?Critical(5)
Average(2) Non Critical(0)";
cin>>b[3];
Medium(2) Light(0)";
cin>>b[4];
cout<<"\n\n6.Does the system require online data entry?
Heavy(5) Medium(2) Least(0)";
cin>>b[5];
cout<<"\n\n7.Does the online data entry require input
transaction to be built over \nmultiple screens or opeartions?
Yes(5) To some extent(2) No(0)";
cin>>b[6];
cout<<"\n\n8.How often is updation of master files
required?Regularly(5) Morderately(2) \nRarely(0)";
cin>>b[7];
cout<<"\n\n9.How dependant are other systems on this
one?Very Much(5) Partially(2) \nIndependant(0)";
cin>>b[8];
cout<<"\n\n10.What is the complexities of
input,output,files or inquires?Complex(5) \nAverage(2)
Simple(0)";
cin>>b[9];
cout<<"\n\n11.Is the internal processing complex?
Complex(5) Average(2) Simple(0)";
cin>>b[10];
cout<<"\n\n12.Is the code designed to be reusable?Yes(5)
To some extent(2) No(0)";
cin>>b[11];
cout<<"\n\n13.Is the system designed for multiple
installations in different organisation?\nYes(5) Few(2)
No(0)";
cin>>b[12];
cout<<"\n\n14.Is the application designed to facilitate
change and ease of use by the user?User friendly(5) Average
(2) Highly Technical(0)";
cin>>b[13];
getch();

clrscr();
for(int i=0;i<14;i++)
fi=fi+b[i];

## cout<<"\nFi is found to be :"<<fi;

if(a[0]<=2)
w=a[0]*3;
if((a[0]>2)&&(a[0]<=6))
w=a[0]*4;
if(a[0]>6)
w=a[0]*6;

if(a[1]<=2)
x=a[1]*4;
if((a[1]>2)&&(a[1]<=6))
x=a[1]*5;
if(a[1]>6)
x=a[1]*7;

if(a[2]<=2)
y=a[2]*3;
if((a[2]>2)&&(a[2]<=6))
y=a[2]*4;
if(a[2]>6)
y=a[2]*6;

if(a[3]<=2)
z=a[3]*7;
if((a[3]>2)&&(a[3]<=6))
z=a[3]*10;
if(a[3]>6)
z=a[3]*15;

if(a[4]<=2)
z2=a[4]*5;
if((a[4]>2)&&(a[4]<=6))
z2=a[4]*7;
if(a[4]>6)
z2=a[4]*10;

ct=w+x+y+z+z2;

## cout<<"\n\n\nComputation of count total :\n";

textcolor(RED);
cprintf("\n\nMEASUREMENT PARAMETERS
COUNT SIMPLE AVERAGE COMPLEX ");
cout<<"\n----------------------------------------------------------------
-------";
cout<<"\nNumber of Inputs "<<a[0]<<"
3 4 6 ="<<w;
cout<<"\nNumber of Outputs "<<a[1]<<" 4
5 7 ="<<x;
cout<<"\nNumber of User Inquires "<<a[2]<<"
3 4 6 ="<<y;
cout<<"\nNumber of Files "<<a[3]<<" 7
10 15 ="<<z;
cout<<"\nNumber of External Interface "<<a[4]<<"
5 7 10 ="<<z2;
cout<<"\nCount Total
="<<ct;
textcolor(WHITE);

## cout<<"\n\nFp = count total * c.a.f \n\n{where c.a.f is

cout<<"\n\n\n\nFp = count total * [0.65 +0.01*Fi]
\n\n{where [0.05+0.01*Fi] is c.a.f}";

caf=0.65+(0.01*fi);
fp=ct*caf;
cout<<"\n\n\n\n\nThe c.a.f is :"<<caf;
cout<<"\n\nThe Fp is : "<<fp;

getch();
clrscr();
cout<<"\n\n\n\nRESULT:-";
if(caf==0.65)
cout<<"\n\n1.Your software is small and hence has
negligible complexity.\n2.It would not require much effort to
engineer and is least prone to errors.\n3.Error Correction
will be easy.";

if((caf>0.65)&&(caf<1.35))
cout<<"\n\n1.Your software is of average size and has
some complexity associated with it.\n2.Engineering it would
require moderate effort and has medium probability of
\nerror.\n3.Error correction would require marginal
effort";

if(caf==1.35)
cout<<"\n\n1.Your software is of very large size.\n2.It is
bound to be complex and would require intensive
effort.\n3.It has a high probability of errors.";

cout<<"\n\nRECOMMENDATIONS:-";
if(caf==0.65)
cout<<"This software is the most ideal one and would have
least of no errors.It is like a dream come true for the
software company.";

if((caf>0.65)&&(caf<1.35))
cout<<"This software is good and will stand as one of the
successful \nsoftwares of the future.";
if(caf==1.35)
cout<<"The analysis of the model is required, since this
software will never satisfy \nthe needs of its customers.";
getch();
measure();
}

void hal()
{ clrscr();
float n1,n2,N1,N2;
float N,V,L,PL,e;
gotoxy(30,4);
cprintf("METRICS FOR SOURCE CODE");
textcolor(GREEN);
gotoxy(30,5);
cprintf("_______________________");
textcolor(WHITE);
cout<<"\n\n\n1.Enter the number of distinct opearators
that appear in the program :- ";
cin>>n1;
cout<<"\n\n\n2.Enter the number of distinct opearands
that appear in a program :- ";
cin>>n2;
cout<<"\n\n\n3.Enter the total number of opeartors
occurences :- ";
cin>>N1;
cout<<"\n\n\n4.Enter the total number of operand
occurence :- ";
cin>>N2;

N=(n1*lg(n1))+(n2*lg(n2));
V=N*lg(n1+n2);
L=((2.0/n1)*(n2/N2));
getch();
clrscr();

## cout<<"RESULT OF METRICS FOR SOURCE

CODE:\n\n";
cout<<"\nLength ="<<N;
cout<<"\nVolume ="<<V;
cout<<"\nVolume Ratio ="<<L;

float s,p;
PL=1/((n1/2)*(N2/n2));
e=V/PL;
cout<<"\n\n\n\n\nRESULT OF METRICS FOR TESTING
:\n\n";
cout<<"\nProgram Level is ="<<s;
cout<<"\n\nSoftware Science Effort is ="<<p;
getch();
}

float lg(float x)
{
float s;
s=log(x)/log(2);
return s;
}
/********METRICS FOR MAINTAINANCE*********/

void maintain()
{
clrscr();
float mt,fc,fa,fd;
double smi;
gotoxy(30,4);
cprintf("METRICS FOR MAINTAINANCE");
textcolor(GREEN);
gotoxy(30,5);
cprintf("______________________");
textcolor(WHITE);
cout<<"\n\nEnter the number of modules in the current
release :";
cin>>mt;
cout<<"\n\nEnter the number of modules in the curent
release that have been changed :";
cin>>fc;
cout<<"\n\nEnter the number of modules in the current
release that have been added :";
cin>>fa;
cout<<"\n\nEnter the number of modules from the
preceeding release that were deleted in \nthe current
release :";
cin>>fd;
smi=(mt-(fa+fc+fd))/mt;
getch();
clrscr();
cout<<"The SMI or software maturity index is found out to
be:- ";
cout<<"\n\nSMI = "<<smi;
getch();
}

{ clrscr();
int s;
gotoxy(34,4);
textcolor(CYAN);
gotoxy(34,5);
cprintf(" _________");
textcolor(WHITE);
gotoxy(27,10);
cprintf("1.Metrics for Analysis Model");
gotoxy(27,12);
cprintf("2.Metrics for Source Code and Testing");
gotoxy(27,14);
cprintf("3.Metrics for Maintainance");
gotoxy(27,16);
cprintf("4.Exit");
gotoxy(27,20);
cin>>s;

switch(s)
{
case 1: measure();
break;

case 2: hal();
break;
case 3: maintain();
break;

case 4: exit(0);
break;

}
getch();

}
/********************3D*******************/

void d3()
{
int a[6];
int b[6];

clrscr();

QUESTIONS:-";
cout<<"\n\n\n1.How many inputs does your system
require? ";
cin>>a[0];
cout<<"\nWeight: ";
cin>>b[0];
cout<<"\n\n2.How many outputs will the system
produce?";
cin>>a[1];
cout<<"\nWeight: ";
cin>>b[1];
cout<<"\n\n3.How many users inquires does your system
entertain ?";
cin>>a[2];
cout<<"\nWeight: ";
cin>>b[2];
cout<<"\n\n4.How many files does the system require?";
cin>>a[3];
cout<<"\nWeight: ";
cin>>b[3];
cout<<"\n\n5.How many external interface does your
system require?";
cin>>a[4];
cout<<"\nWeight: ";
cin>>b[4];
cout<<"\n\n6.How many transformations does the system
do?";
cin>>a[5];
cout<<"\nWeight: ";
cin>>b[5];
cout<<"\n\n7.How many transitions does the system go
through?";
cin>>a[6];
cout<<"\nWeight: ";
cin>>b[5];
getch();

clrscr();
int s=0;
for(int i=0;i<7;i++)
s=s+(a[i]*b[i]);
cout<<"\n\nRESULT:- ";
cout<<"\n\nThe 3D funtion point index is found out to be :
"<<s;
getch();
measure();
}
void main()
{
clrscr();