IT311 - OOP Laboratory Exercise
Problem: Sorted Words
Background: What background? Seemed like a good idea at the time...
Input: Anyway, you're to write a program that reads in a whole bunch of words (each word is no more than 20 characters). For our purposes, words are to be separated by spaces, commas (,), !, ?, and periods (.). No word goes past the end of a line. All comparisons should ignore case.
Output: Output the sorted words, one per line, in lower case.
Sample Input:
How much wood would a woodchuck chuck if a woodchuck could chuck wood? Well? What
do you think? Are you feeling well?
Sample Console:
a
a
are
chuck
chuck
could
do
feeling
how
if
much
think
well
well
what
wood
wood
woodchuck
woodchuck
would
Sample code:
Background: What background? Seemed like a good idea at the time...
Input: Anyway, you're to write a program that reads in a whole bunch of words (each word is no more than 20 characters). For our purposes, words are to be separated by spaces, commas (,), !, ?, and periods (.). No word goes past the end of a line. All comparisons should ignore case.
Output: Output the sorted words, one per line, in lower case.
Sample Input:
How much wood would a woodchuck chuck if a woodchuck could chuck wood? Well? What
do you think? Are you feeling well?
Sample Console:
a
a
are
chuck
chuck
could
do
feeling
how
if
much
think
well
well
what
wood
wood
woodchuck
woodchuck
would
Sample code:
2 comments:
kuyawa jud aning Sir Mark uie!
Thanks glat. for the students man na!
Post a Comment