# Software Engineering | Calculation of Function Point (FP)

Function Point (FP) is an element of software development which helps to approximate the cost of development early in the process. It may measures functionality from user’s point of view.

**Counting Function Point (FP):**

**Step-1:**F = 14 * scale

Scale varies from 0 to 5 according to character of Complexity Adjustment Factor (CAF). Below table shows scale:

0 - No Influence 1 - Incidental 2 - Moderate 3 - Average 4 - Significant 5 - Essential

**Step-2:**Calculate Complexity Adjustment Factor (CAF).CAF = 0.65 + ( 0.01 * F )

**Step-3:**Calculate Unadjusted Function Point (UFP).TABLE (Required)

Function Units Low Avg High EI 3 4 6 EO 4 5 7 EQ 3 4 6 ILF 7 10 15 EIF 5 7 10 Multiply each individual function point to corresponding values in TABLE.

**Step-4:**Calculate Function Point.FP = UFP * CAF

**Example:**

Given the following values, compute function point when all complexity adjustment factor (CAF) and weighting factors are average.

User Input = 50 User Output = 40 User Inquiries = 35 User Files = 6 External Interface = 4

**Explanation:**

**Step-1:**As complexity adjustment factor is average (given in question), hence,scale = 3. F = 14 * 3 = 42

**Step-2:**CAF = 0.65 + ( 0.01 * 42 ) = 1.07

**Step-3:**As weighting factors are also average (given in question) hence we will multiply each individual function point to corresponding values in TABLE.UFP = (50*4) + (40*5) + (35*4) + (6*10) + (4*7) = 628

**Step-4:**Function Point = 628 * 1.07 = 671.96

This is the required answer.

Program to calculate Function Point is as follows :-

`#include <bits/stdc++.h>` `using` `namespace` `std;` ` ` `// Function to calculate Function Point` `void` `calfp(` `int` `frates[][3], ` `int` `fac_rate)` `{` ` ` ` ` `// Function Units` ` ` `string funUnits[5] = {` ` ` `"External Inputs"` `,` ` ` `"External Outputs"` `,` ` ` `"External Inquiries"` `,` ` ` `"Internal Logical Files"` `,` ` ` `"External Interface Files"` ` ` `};` ` ` ` ` `// Weight Rates` ` ` `string wtRates[3] = { ` `"Low"` `, ` `"Average"` `, ` `"High"` `};` ` ` ` ` `// Weight Factors` ` ` `int` `wtFactors[5][3] = {` ` ` `{ 3, 4, 6 },` ` ` `{ 4, 5, 7 },` ` ` `{ 3, 4, 6 },` ` ` `{ 7, 10, 15 },` ` ` `{ 5, 7, 10 },` ` ` `};` ` ` ` ` `int` `UFP = 0;` ` ` ` ` `// Calculating UFP (Unadjusted Function Point)` ` ` `for` `(` `int` `i = 0; i < 5; i++) {` ` ` ` ` `for` `(` `int` `j = 0; j < 3; j++) {` ` ` ` ` `int` `freq = frates[i][j];` ` ` ` ` `UFP += freq * wtFactors[i][j];` ` ` `}` ` ` `}` ` ` ` ` `// 14 factors` ` ` `string aspects[14] = {` ` ` `"reliable backup and recovery required ?"` `,` ` ` `"data communication required ?"` `,` ` ` `"are there distributed processing functions ?"` `,` ` ` `"is performance critical ?"` `,` ` ` `"will the system run in an existing heavily utilized operational environment ?"` `,` ` ` `"on line data entry required ?"` `,` ` ` `"does the on line data entry require the input transaction to be built over multiple screens or operations ?"` `,` ` ` `"are the master files updated on line ?"` `,` ` ` `"is the inputs, outputs, files or inquiries complex ?"` `,` ` ` `"is the internal processing complex ?"` `,` ` ` `"is the code designed to be reusable ?"` `,` ` ` `"are the conversion and installation included in the design ?"` `,` ` ` `"is the system designed for multiple installations in different organizations ?"` `,` ` ` `"is the application designed to facilitate change and ease of use by the user ?"` ` ` `};` ` ` ` ` `/*` ` ` `Rate Scale of Factors` ` ` `Rate the following aspects on a scale of 0-5 :-` ` ` `0 - No influence ` ` ` `1 - Incidental ` ` ` `2 - Moderate ` ` ` `3 - Average ` ` ` `4 - Significant ` ` ` `5 - Essential ` ` ` `*/` ` ` ` ` `int` `sumF = 0;` ` ` ` ` `// Taking Input of factors rate` ` ` `for` `(` `int` `i = 0; i < 14; i++) {` ` ` ` ` `int` `rate = fac_rate;` ` ` ` ` `sumF += rate;` ` ` `}` ` ` ` ` `// Calculate CFP` ` ` `double` `CAF = 0.65 + 0.01 * sumF;` ` ` ` ` `// Calculate Function Point (FP)` ` ` `double` `FP = UFP * CAF;` ` ` ` ` `// Output Values` ` ` `cout << ` `"Function Point Analysis :-"` `<< endl;` ` ` ` ` `cout << ` `"Unadjusted Function Points (UFP) : "` `<< UFP << endl;` ` ` ` ` `cout << ` `"Complexity Adjustment Factor (CAF) : "` `<< CAF << endl;` ` ` ` ` `cout << ` `"Function Points (FP) : "` `<< FP << endl;` `}` ` ` `// driver function` `int` `main()` `{` ` ` `int` `frates[5][3] = {` ` ` `{ 0, 50, 0 },` ` ` `{ 0, 40, 0 },` ` ` `{ 0, 35, 0 },` ` ` `{ 0, 6, 0 },` ` ` `{ 0, 4, 0 }` ` ` `};` ` ` ` ` `int` `fac_rate = 3;` ` ` ` ` `calfp(frates, fac_rate);` ` ` ` ` `return` `0;` `}` |

**Output:**

Function Point Analysis :- Unadjusted Function Points (UFP) : 628 Complexity Adjustment Factor (CAF) : 1.07 Function Points (FP) : 671.96

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the **CS Theory Course** at a student-friendly price and become industry ready.