CS1411 - 160 - Programming Principles I, Spring 2005

Extra Credit Assignment for MidTerm

Do the following things for up to 20 extra points on the MidTerm (however, you cannot exceed 100):

  • Write a function that will capitalize a word (First Letter uppercase, rest lowercase) given as a C-string. The function should have no direct screen input and output, but rather a parameter, probably pass-by-reference
  • Same as above, but with a C++-String
  • Write a main function that asks the user whether to check the C or C++-string version, inputs a string, and then calls the approrpiate function and displays the output
  • Move you string functions into a separate .cpp file, add a header file with prototypes, protect that agains multiple inclusions, and use it from the main function

Deadline

Pass a printout (make sure that I know which part is which file) in in the first class after spring break (tue, mar 22). If you can't come to class, put it in my mailbox in the CS department before class time. Emails will not be accepted. Late work will not be accepted.

Questions?

If the instructions are unclear or you have any other questions, please email me