Program Grading Guide Name_______________________________
CSC 313
Assignment 1
Program comments and documentation:
Unacceptable (0) Acceptable (0.5) Excellent (1)
Program construction and readability
Unacceptable (0) Acceptable (0.5) Excellent (1)
Program output:
(half point each)
Total number of words
Number of different words
Ratio
(1 point each)
List of more than 2%
Additional requirements:
(half point each)
Reads file name
Uses StreamTokenizer
Uses SetOfCountables class to count words
Part II:
The answer to the first question is the same for all three code segments. Most will say that “sum++” is most frequently executed, which is okay. Strictly speaking, the comparison in the inner-most for loop is executed one time more than “sum++”. If they use the for-loop comparison for the analysis, the answers for number 2 will be slightly larger. Scoring guide: Score 1 point for each correct answer to Question 3 and score up to 1 point overall for showing work in Questions 1 and 2.
A. 2) n / 2 3) O(n)
B. 2) n3 3) O(n3)
C. 2) 0 + 1 + 2 + … + (n – 1) = n (n – 1) / 2
3) O(n2)
Score out of 10 (round up to next whole number):