read
|
1
|
==
|
5
|
string
|
5
|
,
|
2
|
or
|
6
|
x
|
9
|
;
|
7
|
and
|
1
|
y
|
8
|
type
|
6
|
>=
|
3
|
z
|
8
|
=
|
5
|
|
3
|
0
|
3
|
if
|
4
|
+
|
3
|
|
|
( )
|
4
|
print
|
1
|
|
|
|
|
Calculate Halstead's basic measures on the triangle code from Problem 5.
operators operands
11 = 14
|
12 = 5
|
1 = 19
|
12* = 3
|
N1 = 51
|
N2 = 33
|
N = 84
|
|
Est N = 14 * log2 14 + 5 * log2 5
= 14 * 3.8 + 5 * 2.3 = 64.7 + 11.5 = 76.2
V = 84 * log2 19 = 84 * 4.25 = 357
V* = 5 log2 5 = 5 * 2.3 = 11.5
L = 11.5 / 357 = 0.032