[MSOE Homepage]

Dr. Taylor's MSOE homepage

Courses

Unix is a Four
Letter Word

My Photo Album

My Personal Homepage

CS-100 Main page

CS-100 -- Lab 6: Palindromes

Fall Quarter 1999



Electrical Engineering and Computer Science Department
Dr. Christopher C. Taylor

S-331, 277-7339

www.msoe.edu/~taylor/

Purpose

The lab is designed to further your programming skills and become more familiar with writing and calling your own functions.

Assignment

Palindromes are words or phrases that are the same if read forwards or backwards. For example, did is a palindrome because the word is the same whether we read it from the left or from the right.

  • Download the palin.cpp source file. This file contains source code for a program which checks to see if the user's input is a palindrome.
  • Some of the functions are missing. It is your task to implement the missing functions. Some of these were written in class on Monday and will just need to be typed in. You will need to write the rest of the functions.
  • Your program should identify all of the following as palindromes:
    • Pull up if I pull up.
    • Lew, Otto has a hot towel!
  • Once all of the functions have been written, test your program with the phrases above and the following inputs:
    • Gravity isn't just a good idea, it's the law.
    • Step on no pets
    • A shallow swallow
  • Include the program output resulting from these tests in your report.

Programming consideration: It is always good in program design to consider potential modifications that may be required a some later date. Be sure to keep this in mind when designing your program.

Lab report (due 4:30pm Tuesday, October 26, 1999)

This lab report need not be self-contained. At a minimum, your report should include:

  • A brief discussion of what you learned and what problems you encountered.
  • Documented source code (you may wish to include this at the end of your report)
  • Sample output from your program.
  • Any suggestions on how the lab could be improved.

As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic Submission Guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well.

If you have any questions, consult the instructor.


This page was created by Dr. Christopher C. Taylor copyright 1999.