This does not seem to be in syllabus now. And online resources showed different ways to do this- some tells to include function declaration- others tell to ignore it. And none of the method seem to give any of the choices also.

Dark Mode

716 views

0 votes

Operator | Frequency |
---|---|

if | 1 |

* | 6 |

== | 1 |

return | 2 |

= | 3 |

Number of unique operators (n1) = 5

Number of operators (N1) = 13

Operand | Frequency |
---|---|

temp | 2 |

A1 | 3 |

A2 | 3 |

Number of unique operands (n2) = 3

Number of operands (N2) = 8

N = N1+N2 = 8 + 13 = 21

n = n1+n2 = 5 + 3 = 8

Program Volume (V) = N log_{2} n

= 21 log_{2}8

= 21*3 = 63

Program Difficulty (D) = n1/2 * (N2/n2)

= 5/2 * 8/3

=20/3

Program Effort (E) = D * V

= 20/3 * 63

= 420

[float, ; and () are not considered as operators here while many places they are also considered]