Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program with three functions: upper, lower, and reverse. The upper funct

ID: 3639942 • Letter: W

Question

Write a program with three functions: upper, lower, and reverse. The upper function should accept C-string as an argument. It should step through all the characters in the string, converting each to uppercase. The lower function, too, should accept a pointer to a C-string as an argument. It should step through all the characters in the string, converting each to lowercase. Like upper and lower, reverse should also accept a C-string. As it steps through the string, it should test each character to determine whether it is upper or lowercase, it should be converted to lowercase. If a character is lowercase, it should be converted to uppercase.

Test the functions by asking for a string in function main, then passing it to them in the following order: reverse, lower, and upper.

Explanation / Answer

#include using namespace std; void reverse(char *c) { int i = 0; while(c[i] != '') //for(int i = 0; i < 50; ++i) { if(c[i] == tolower(c[i])) c[i] = toupper(c[i]); else c[i] = tolower(c[i]); cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote