-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathp5_b.cpp
31 lines (30 loc) · 917 Bytes
/
p5_b.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
#include <iostream>
#include <math.h>
//Intermediate COCOMO
//Sahil Malik
using namespace std;
double 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 main(){
double effort,Time,staff,productivity;
int size=0;
int model=0;
cout<<"Enter KLOC: ";
cin>>size;
if(size>=2 && size <=50)
model=0;
else if(size>50 && size<=300)
model=1;
else if(size>300)
model=2;
effort=table[model][0]*pow(size,table[model][1]);
Time=table[model][2]*pow(effort,table[model][3]);
staff=effort/Time;
productivity=size/effort;
cout<<"\nEffort ="<<effort<<" Person-Month";
cout<<"\n\nDevelopment Time ="<<Time<<" Months";
cout<<"\n\nAverage Staff Required ="<<staff<<" Persons";;
cout<<"\n\nProductivity ="<<productivity<<" KLOC/Person-Month";
return 0;
}