Write a program with three functions: reverse, upper, lower. Like upper and lowe
ID: 3654069 • Letter: W
Question
Write a program with three functions: reverse, upper, lower.
Like upper and lower, reverse should also accept a pointer to a c-string. As it steps through the string, it should test each character to determine whether it is upper or lowercase. If a character is uppercase, it should be converted to lowercase. Likewise, if a character is upper case it should be converted to lowercase.
The upper function should accept a pointer to a c-string as an argument. It should step through each character in the string, converting it to uppercase.
The lower function, to should accept a pointer to a c-string as an argument. It should step through each character in the string converting it to lower case.
Test on a file called: catinthehat.dat
Count each character as it is read into the file and then dynamically allocate an array that will hold these characters
=>Pass the array to the functions in the following order: reverse, lower, and upper.
Explanation / Answer
#include #include #include using namespace std; char* reverse (char*, int); char* lower (char*, int); char* upper (char*, int); int main () { const int SIZE = 80; char myString [SIZE]; int strLength; //Prompt user for string coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.