in Others retagged by
716 views
0 votes
0 votes
void swap(float* A1, float* A2)
{
    float temp;
    if (*A1 = = *A2) return;
    temp = *A1;
    *A1 = *A2;
    *A2 = temp;
    return;
}

The program effort for the above module using Halstead's method is

  1. 315
  2. 330
  3. 393
  4. 403
in Others retagged by
716 views

2 Answers

0 votes
0 votes

1 comment

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.
2
2
0 votes
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 log2 n

= 21 log28

= 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]

by
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true