-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathp6.cpp
127 lines (117 loc) · 3.62 KB
/
p6.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#include<stdio.h>
#include<conio.h>
#include<math.h>
int fround(float x)
{
int a;
x=x+0.5;
a=x;
return(a);
}
float costdrivers[15][6]={
{0.75,0.88,1,1.15,1.40,-1},
{-1,0.94,1,1.08,1.16,-1},
{0.70,0.85,1,1.15,1.30,1.65},
{-1,-1,1,1.11,1.30,1.66},
{-1,-1,1,1.06,1.21,1.56},
{-1,0.87,1,1.15,1.30,-1},
{-1,0.87,1,1.07,1.15,-1},
{1.46,1.19,1,0.86,0.71,-1},
{1.29,1.13,1.00,0.91,0.82,-1},
{1.42,1.17,1,0.86,0.70,-1},
{1.21,1.10,1,0.90,-1,-1},
{1.14,1.07,1,0.95,-1,-1},
{1.24,1.10,1.00,0.91,0.82,-1},
{1.24,1.10,1,0.91,0.83,-1},
{1.23,1.08,1,1.04,1.10,-1}
};
float mp[6][5]={
{0.06,0.16,0.26,0.42,0.16},
{0.06,0.16,0.24,0.38,0.22},
{0.07,0.17,0.25,0.33,0.25},
{0.07,0.17,0.24,0.31,0.28},
{0.08,0.18,0.25,0.26,0.31},
{0.08,0.18,0.24,0.24,0.34}
};
float tp[6][5]={
{0.10,0.19,0.24,0.39,0.18},
{0.12,0.19,0.21,0.34,0.26},
{0.20,0.26,0.21,0.27,0.26},
{0.22,0.27,0.19,0.25,0.29},
{0.36,0.36,0.18,0.18,0.28},
{0.40,0.38,0.16,0.16,0.30}
};
int main()
{
float table[3][4]={3.2,1.05,2.5,0.38,3.0,1.12,2.5,0.35,2.8,1.20,2.5,0.32};
int i,j,size,model,rating,S;
char mode[][15]={"Organic","Semi-Detached","Embedded"};
char driver[15][6]={"RELY","DATA","CPLX","TIME","STOR","VIRT","TURN","ACAP","AEXP","PCAP",
"VEXP","LEXP","MODP","TOOL","SCED"};
float effort,EAF,a,time,staff,productivity;
char phases[5][30]={"Planning and Requirements","System Design","Detail Design","Module Code and Test","Integration and Test"};
printf("\nEnter the size of project : ");
scanf("%d",&size);
if(size>=2 && size<=50)
model=0;
else if(size>50 && size<=300)
model=1;
else if(size>300)
model=2;
printf("\nMode = %s",mode[model]);
EAF=1;
for(i=0;i<15;i++)
{
do
{
printf("\nRate cost driver %s on scale of 0-5 : ",driver[i]);
printf("\n0-Very Low\t1-Low\t2-Nominal\t3-High\t4-Very High\t5-Extra High\n");
scanf("%d",&rating);
a=costdrivers[i][rating];
if(a==-1)
{
printf("\nNo value exist for this rating..Enter another rating...\n");
}
}while(a==-1);
EAF=EAF*a;
}
printf("\nEAF = %f",EAF);
effort=(table[model][0]*pow(size,table[model][1])) * EAF;
time=table[model][2]*pow(effort,table[model][3]);
staff=effort/time;
productivity=size/effort;
printf("\n\nEffort = %f Person-Month",effort);
printf("\nDevelopment Time = %f Months",time);
printf("\nAverage Staff Required = %d Persons",(staff));
printf("\nProductivity = %f KLOC/Person-Month",productivity);
printf("\n\n");
if(model==0)
{
printf("\nEnter Ogranic - Small(0) or Medium(1) : ");
scanf("%d",&S);
}
else if(model==1)
{
printf("\nEnter Semi-Detached - Medium(2) or Large(3) : ");
scanf("%d",&S);
}
else if(model==2)
{
printf("\nEnter Embedded - Large(4) or Extra Large(5) : ");
scanf("%d",&S);
}
printf("\n\nPhase-wise Distribution of Effort is :\n\n");
for(i=0;i<5;i++)
{
printf("\n%s Phase = ",phases[i]);
printf("%f",effort*mp[S][i]);
}
printf("\n\nPhase-wise Distribution of Development Time is :\n\n");
for(i=0;i<5;i++)
{
printf("\n%s Phase = ",phases[i]);
printf("%f",time*tp[S][i]);
}
//getch();
return 0;
}