In my homework, I need to create a program that allows the user to enter a password. The the the program needs to change all vowels (A,E,I,O, and U) in the orginal password into the letter X. All numbers in the password should be replaced with the letter Z. And the orginal password should be reversed. This is what I have so far any help is appricated. Thanks.
if (currentChar == "0" ...
1) A char literal is represented by single quotes: '0'
2) currentChar wasn't declared
3) You whould need to place this in a loop
You can use the isdigit() function to determine if the character is in '0'..'9'.
I recommend you write yourself a function called isvowel() that takes a char as argument and returns whether or not it is a vowel.
As a matter of procedure, did your original assignment ask you to convert all letters to lowercase?
[edit] BTW, if you want to use isdigit() and tolower(), you should #include <cctype> .