Question
Create a flow chart for the following code:: if you could just tell me the basic steps of what this code does that would be
Create a flow chart for the following code:: if you could just tell me the basic steps of what this code does that would be appreciated
#include
const int SIZE = 80;
void upper(char[]); void lower(char[]); void reverse(char[]); int main() {
char str1[SIZE], str2[SIZE], str3[SIZE];
cout << "Enter a string: "; cin.getline(str1, SIZE);
strcpy(str2, str1); strcpy(str3, str1); cout << "After a call to Upper: "; upper(str1); cout << str1 << endl;
cout << "After a call to Lower: "; lower(str2); cout << str2 << endl;
cout << "After a call to Reverse: "; reverse(str3); cout << str3 << endl; return 0; }
void upper(char str[]) { int i = 0; while(str[i]) { str[i] = toupper(str[i]); i++; } }
void lower(char str[]) { int i = 0; while(str[i]) { str[i] = tolower(str[i]); i++; } }
void reverse(char str[]) { int i = 0; while(str[i]) { if(islower(str[i])) str[i] = toupper(str[i]); else str[i] = tolower(str[i]); i++; } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started