Saturday, November 20, 2010

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:

2 comments:

glaiglay November 20, 2010 at 9:19 PM  

kuyawa jud aning Sir Mark uie!

marco November 22, 2010 at 12:59 AM  

Thanks glat. for the students man na!

About

My photo
Hi! Mabuhay everyone! I am Mark Van M. Buladaco! I am from Davao City! Hope you enjoy my blog!

Contact me

476 alley Malvar St., Davao City, Philippines
celticguardiandancingelf@yahoo.com
Web Marketingdrive recovery software