Project 1

Background

For this project we are going to implement and basic function for strings, toUpper. Often it is necessary to either compare strings that are all in the same case or simply have a way to take a string and get a version that is in all upper, or lower for that matter, case.

Details

For this we are going to write a simple function. This function will be called toUpper and it will both receive and return a string. The purpose of this function is to return a version of the string that is all in upper case. How this is done is up to, but a basic outline will be sketched out below.

So to complete this project, you will need an algorithm to complete the task. Here is a skeleton of how you could do this.

  1. Create a local string to use to be the all upper case version.
  2. Loop over the string and for each character in the string.
  3. If the character is already upper case, then simply add it to the upper case version.
  4. If the character is lower case, make it upper case and add it to the string.
  5. If the character isn't a letter, then simply add it to the upper case version.
  6. Return the upper case version.

So you can hopefully see that this project is working with 3 basic ideas,

  1. Looping
  2. Selection
  3. Variable declaration

Requirements

In order to be able to grade this there are several requirements that must be met.

  1. Your function must be declared in a header file named, toUpper.h
  2. Your function must use the following signature: string toUpper( string );
  3. You must include a brief comment before the function in the cpp file. This is a header comment.
  4. You must comment your implementation as needed. All code should have at least a few comments.

Grading

To grade this, we are going to be using the on line automatic grading system Web-CAT https://web-cat.cs.vt.edu You will simply login with your VT PID and password. You will need to zip up your toUpper.h header and the implementation file and turn them in. If you have implemented your entire function in the toUpper.h file, do not submit any cpp files with your code Wait and Web-CAT will give you a grade within a few minutes. You may submit more than once and continue to submit until you have achieve the score you wish. Please do not hesitate to ask if you get a hint you don't understand.

Due

This is due Friday February 14 Tuesday February 18 by 11:55 PM.