-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBasic-cocomo.cpp
47 lines (37 loc) · 939 Bytes
/
Basic-cocomo.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
// Write a program to implement Basic COCOMO model (effort, development time and people required)
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
system("cls");
cout<<"\n-----Basic COCOMO model-----\n";
int kloc;
cout<<"Enter the size of project (in KLOC): ";
cin>>kloc;
float effort,time,staff;
float a,b,c,d;
string mode;
if(kloc<=50)
{
a=2.4, b=1.05, c=2.5, d=0.38;
mode = "organic";
}
else if(kloc<=300)
{
a=3.0, b=1.12, c=2.5, d=0.35;
mode = "semidetached";
}
else
{
a=3.6, b=1.20, c=2.5, d=0.32;
mode = "embedded";
}
effort = a * pow(kloc, b);
time = c * pow(effort, d);
staff = effort/time;
cout<<"\nAccording to KLOC, the mode is assumed to be "<<mode<<":\n";
cout<<"Effort required: "<<effort<<" PM\n";
cout<<"Development time: "<<time<< " months\n";
cout<<"Average staff size: "<<staff<<" persons\n\n";
}