Assignment 4 Code Review

12 November 2002 - CS 509


The Problem


The Solution


Design


Test Cases


What Happened?


Line Statistics - Newlines

000100200
011
101
203
301
403
505
60
7023
80
9011
Totals3181


Line Statistics - Semicolons

000
0
10
20
301
403
502
606
702
805
903
Totals22


Procedure Statistics

totalpages per procedure
procs12345
11
11
11
11
11
11
211
211
211
312
312
321
33
33
413
431
541


Control Complexity

while r.v1 == max or r.v2 == max or r.v3 == max

  if     (*it).at_vector == 0)
     and r.v1 == max
     and mode_assigned[(*it).of_mod] == -1
     
     mode_assigned[(*it).of_mod]=1
     r.v1 = (*it).of_mod
     it = v.erase(it)

  else if     (*it).at_vector == 1
	  and r.v2 == max
	  and mode_assigned[(*it).of_mod] == - 1

     mode_assigned[(*it).of_mod]=1
     r.v2 = (*it).of_mod
     it = v.erase(it)

  else if     (*it).at_vector == 2 
	  and r.v3 == max 
	  and mode_assigned[(*it).of_mod] == -1

      mode_assigned[(*it).of_mod]=1
      r.v3=(*it).of_mod
      it = v.erase(it)

   else ++it


Complexity


Informative Documentation


Behavioral Documentation


Function Documentation


Other Documentation Recommendations


Use Generic Algorithms


Points to Remember


This page last modified on 13 November 2002.