Tuesday, July 24, 2012

Programming Challenge#1


Programming Challenge#1
One Hour Programming Project
July 25, 2012

1. Upper and Lower caps.
given a string:
Make string all caps.
Make string all lower caps.
Example:
a SMALL misfortune (original text)
a small misfortune (lower caps)
A SMALL MISFORTUNE (upper caps)


2. Find location of char/string in another string
given 2 equal length string
find the location of a char in text 1
Find the character in same location in text 2
Example:
a SMALL misfortune (text 1)
The quick brown fox (text 2)
Result for searching A (char)
q
Result for searching SMALL (string)
e qui


3. Alphabets
given a text string (text 1)
and a substring (text 2)
Find:
1. all letters in the text string
2. Determine if text string is pangram (all letters used)
3. all letters in text 1 string, NOT in text 2
Example:
The quick brown fox jumps over the lazy dog. (text 1)
AEIOU (text 2)
Result:
1. THEQUICKBROWNFXJMPSVLAZYDG
2. TRUE
3. THQCKBRWNFXJMPSVLZYDG

Bonus challenge: Load a text file and display the content to the screen.
Extra Challenge: Assigning each line to an array.

No comments: