I'm not sure if I'm doing this part correctly, the part where I have to make it all lower case then to all upper case, then just first name.
#include <iostream>
#include <cstring>
#include <stdio.h>
using namespace std;
int main()
{
char a[3][14] = { "Barack ", "H", " Obama" };
cout << "Enter your full name: ";
cout << a[0] << a[1] << a[2] << endl;
//Find length of name
int i = strlen(a[0]);
int j = strlen(a[1]);
int k = strlen(a[2]);
cout << "\tYou name's length is " << (i+j+k) << endl;
tolower (a[0][0]);
tolower (a[0][1]);
tolower (a[0][2]);
tolower (a[0][0]);
cout << "\tYour name in lower case: " << a[0][0] << a[1] << a[2] << endl;
cout << "\tYour name in upper case: " << a[0] << a[1] << a[2] << endl;
system("pause");
return 0;
}
Output should look like:
Enter your full name: Barack H Obama
You name's length is 14
Your name in lower case: barack h obama
Your name in upper case: BARACK H OBAMA
Your first name: BARACK
BARACK, what is your friend's name? barack
Your name is the same as your friend's name