Hello. Anyone familiar with the Halstead product metrics? we are going to implement it. and again i need some help. here is our algorithm:
1. The user runs the program.
2. The program will ask the user to browse the file he/she wants to be evaluated using the programer's own definition of halstead's product metrics.
3. The program will count the number of operators and operands of the browsed file. The operators and operands will depend in the own definition of the programmer.
3.1 Initialize variable "Doperand" and "Doperator" where the number of distinct operands and distinct operators will be stored respectively.
3.2 The Doperand variable will increment everytime the method of counting the tokens will encounter an operand that is not yet counted by the method.
3.3 Same goes to Doperator variable.
3.4 Initialize variable "operand" and "operator" where the total number of operands and operators will be stored respectively.
3.5 The operand variable will increment everytime the method of counting the tokens will encounter an operand.
3.6 Same goes to operator variable.
3.7 When the method count will no longer encounter a token, the program will display the total number of operands, operators , distinct operators and distinct operands.
4. The user will now then click the "Compute" button to compute for the Program Vocabulary, Program Length, Volume, Difficulty, Level, Effort, Time and Fault Prediction.
4.1 The program will use the counted number of operands, operators, distinct operands and distinct operators.
4.2 The formulas to be used are based on Halstead's formulas.
5. When the program is finish computing, the program will display the computed outputs.