given: the variable str is a string (may be empty) create the counter variable, initialized to -1 if the variable str has any characters then { set counter to 0 create the variable current-character as a character place the first character in str into current-character while more-characters and current-character not a period { add one to (or increment) the counter variable [store the next character from str in current-character] } if current-character is a period then add one to the counter to account for the period. else set counter to -2 } if counter is -1 the string was empty else if counter is -2 there was no period