Assignments On Halstead'S Software Science
Assignments On Halstead'S Software Science
SCIENCE
1. Suppose in a program, the total number of operators is 50, the
total number of operands is 30, the total number of unique
operators is 17, and the total number of unique operands is 7.
Calculate the estimated length, program volume, program level,
programming effort, and programmers time using Halstead's
technique.
2. For the following C program, estimate the Halstead's length and volume measures.
/* Program to calculate GCD of two numbers */
while(x!=y){
if(x<y) then
x=x-y;
else
y=y-x;
}
return x;
int i, j, t;
if ( n < 2 )
return;
t=a[i];
a[i] =a[j];
a[j] = t;
}
4. Calculate the estimated length, program volume, program level, programming effort, and programmer’s
time using Halstead' technique for the following C program.
int bot = 0;
int top = n - 1;
if (table[mid] == item)
return mid;
top = mid - 1;
else
bot = mid + 1;
5. Write a program in Java/Python/C# to implement Halstead's technique for calculating the estimated
length, program volume, program level, programming effort, and programmer’s time for a given program.