Sections 0101, 0102, 0103 and Honors, Fall 1995
Thursday November 2, 1995
Assigned Reading: 9.4
Handouts (available on-line):
Project 4
Topics Covered:
- A closer look at characters and strings.
Our first program
generated an acronym from the user's input. The
output shows that
the program works if the user's input does not begin
with a space, and if each word is separated by only
one character. Otherwise the program gives mangled
output. The second program
corrects these problems. Sample run.
- Our next task is to write a program that detects if the
user's input is a palindrome. The
first program uses a for loop
to produce the correct output.
The second program uses a while
loop to accomplish the same task. Finally, the
third version of the program
checks to see if the user's input is equal to its reversal
using the reverse function.
- We looked at a more complicated program using characters and
strings. This program prints
out the first word in the users input that starts with a vowel.
The program also illustrates the use of the SubString
function from the strlib.h interface.
Sample run.
- Discussed Project 4.
Last Modified:
Fri Nov 3 16:05:05 EST 1995
Richard Chang, chang@gl.umbc.edu