Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 #include #include #include using namespace std;

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sql All In One For Dummies 7 Books In One

Authors: Allen G Taylor ,Richard Blum

4th Edition

1394242298, 978-1394242290

Students also viewed these Databases questions