|
|
|
|
|
|
|
Increment Proper Counter (Inout: upperCount, lowerCount, digitCount, blankCount,
puncCount, leftOverCount; In: ch) Level 1 |
|
|
|
|
|
|
|
|
IF ch is uppercase
Increment upperCount
ELSE IF ch is lowercase
Increment lowerCount
ELSE IF ch is a digit
Increment digitCount
ELSE
SWITCH ch
Blank: Increment blankCount
Punctuation mark: Increment puncCount
Anything else: Increment leftOverCount |
|
|
|
|
|
|
|
|
|
Calculate and Print Percentages (In: upperCount, lowerCount, digitCount, blankCount,
puncCount, leftOverCount) |
|
|
|
|
|
|
|
|
|
Set total = sum of all 6 counters
Print Percent that are uppercase letters:,
upperCount/total * 100
Print Percent that are lowercase letters:,
lowerCount/total * 100
Print Percent that are decimal digits:,
digitCount/total * 100
Print Percent that are blanks:,
blankCount/total * 100
Print Percent that are end-of-sentence punctuation:,
puncCount/total * 100 |
|
|
|
|
|
|
|