CSE 250 - Spring 2009 - Banner
UB -
University at Buffalo, The State University of New York Computer Science and Engineering
  • CSE 250 - Spring 2009
CSE 250 - Spring 2009 - Navigation

In-lab Exercise 1
Last modified: February 15 2009 03:34:59 PM

CSE 250 - Spring 2009 - In-lab Exercise 1

This exercise should be completed individually.

Task 1: Get a working Environment in the Lab

If you are interested in using Eclipse, see information on getting the installed version of Eclipse to have the C++ development tools here.

If you are using another editor, make sure you know how to open it and take a moment to familiarize yourself with it.

Task 2: Completion of coding assignment

Create a C++ header file for the following function definitions named Exercise1.h:

  • bool isPalindrome(int number)
  • bool isPalindrome(string word)
  • int countVowels(string text)

Also create the C++ function definitions for the above mentioned functions in a file named Exercise1.cpp. The functionality for each function should be as follows:

  • isPalindrome(number) - accepts an integer number and determines whether or not the number is a palindrome (that is, the same forwards and backwards). Returns true if palindrome found, false otherwise.

  • isPalindrome(word) - accepts a single word as input and determines whether the word is a palindrome. There are no limits on the size of this "word" or its contents. Returns true if it is a palindrome, false otherwise.

  • countVowels(text) - accepts a string of text and determines how many vowels are in the text. Vowels are considered to be the letters a, e, i, o and u for this exercise. There are no limits on the size of the text or its contents. Returns an integer that represents the number of vowels in the string.


Lastly, create an additional file named Exercise1Driver.cpp which contains a main function and tests the functionality of the functions you created. Realistically, you will be creating this file as you create your definitions. You should include as much testing as you feel is needed to appropriately test the functions you have written.

The names of your methods must follow the above exactly. To test your code, we will be writing a testing program that expects this interface. If you code doesn't work with our testing program, you will receive no credit.

What to submit

You should ensure that all your files are in a directory named Exercise1. Zip up your Exercise1 directory to make a file called Exercise1.zip. You should submit the file Exercise1.zip using the electronic submission command submit_cse250.

Due Date

The files that need to be submitted are due to be turned in by 11:59:59pm on Monday, February 2nd. Note, there will be a new assignment next week and the week after, so plan your work on this assignment accordingly.

CSE 250 - Spring 2009 - Footer

Page maintained by Adrienne Decker

Contact: adrienne@cse.buffalo.edu | 130 Bell Hall | (716)645-3180 x 161