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.
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.
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
.
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.
Page maintained by Adrienne Decker
Contact: adrienne@cse.buffalo.edu | 130 Bell Hall | (716)645-3180 x 161