Question: c++ Using what you have learned about the cString style data types, download and complete the code for the program below. InClassAssignment1.cpp Notes: You may
c++
Using what you have learned about the cString style data types, download and complete the code for the program below.
InClassAssignment1.cpp
Notes:
- You may not modify or change the main() or the method prototypes.
- You are only to implement the 4 necessary methods.
- You will want to look for the '\0' character to find the ends of the strings.
- You may want to think about using while loops instead of for loops for some of the methods.
- Your methods may use each other if you find that helpful.
- In fact, hint! you might find it easier to write the last one first....
- DO NOT USE ANY STRING TOOLS, you must use the CSTRING ideas that we talked about in class for full credit.
- Manipulate the char's and the array!
------------------------------
#include
using namespace std;
void upperCase_cString(char[]);
void lowerCase_cString(char[]);
void reverse_cString(char[]);
int find_len_cString(char[]);
int main()
{
char a[] = "Hello World";
char b[] = {'M','i','c','k','y',' ','M','o','u','s','e','\0'};
char c[] = "abcdefghijklmnopqrstuvwxyz";
char d[] = "ABCDE...VWXYZ";
char e[] = "This is a test \0 OF THE END OF STRING CHARACTER";
cout << "BEFORE" << endl;
cout << a << endl;
cout << b << endl;
cout << c << endl;
cout << d << endl;
cout << e << endl;
cout << endl << "AFTER" << endl<< endl<< endl;
upperCase_cString(a);
cout << a << endl;
lowerCase_cString(b);
cout << b << endl;
reverse_cString(c);
cout << c << endl;
reverse_cString(d);
cout << d << endl;
reverse_cString(e);
cout << e << endl;
cout << find_len_cString(d) << endl;
cout << find_len_cString(e) << endl;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
