NO DATA DECLARATIONS IN PSEUDOCODEExample is somewhat C-like or Java-like.Example of an algorithm…. Should approach being language independent.Make all ‘reasonable’ attempts to eschew language dependencies, such asPerform, etc. Better to say, Generate, or Loop …. End-loop; Calculate, etc.Use scope terminators (if … endif. Loop, endLoop; Indentation is absolutely critical!Print out appropriate heading and make it prettyWhile not EOF do: Scan over all blanks and white space until a character is found (got first character on the line) set can't-be-ascending-flag to 0 set consec cntr to 1 set ascending cntr to 1 write first char of string to screen set read character to hold character While next character read != blanks and white space write character to screen if new char = hold char + 1 add 1 to consec cntr set hold char = new char continue endif if new char >= hold char if consec cntr < 3 set consec cntr to 1 endif set hold char = new char continue endif if new char < hold char if consec cntr < 3 set consec cntr to 1 endif set hold char = new char set can't be ascending flag to 1 continue endif end while if consec cntr >= 3 print (Appropriate message 1 and skip a line) add 1 to consec total endif if can't-be-ascending-flag = 0 print (Appropriate message 2 and skip a line) add 1 to ascending total else print (Sorry message and skip a line) add 1 to sorry total endifend WhilePrint out totals: Number of consecs, ascendings, and
View Full Document