Write a program that inputs a line of text with istream member function getline (as in Chapter 15) into character array s[100]. Output the line in uppercase letters and lowercase letters.
What will be an ideal response?
```
#include
#include
using namespace std;
const int SIZE = 100;
int main()
{
char s[ SIZE ];
int i;
cout << "Enter a line of text:\n";
cin.getline( s, SIZE );
cout << "\nThe line in uppercase is:\n";
// demonstrate function toupper
for ( i = 0; s[ i ] != '\0'; ++i )
cout << static_cast< char >( toupper( s[ i ] ) );
cout << "\n\nThe line in lowercase is:\n";
// demonstrate function tolower
for ( i = 0; s[ i ] != '\0'; ++i )
cout << static_cast< char >( tolower( s[ i ] ) );
cout << endl;
return 0;
} // end main
```
Enter a line of text:
CPPHTP6 Instructor's Manual
The line in uppercase is:
CPPHTP6 INSTRUCTOR'S MANUAL
The line in lowercase is:
cpphtp6 instructor's manual
You might also like to view...
The accompanying figure shows an example of _____ software.
A. paint B. presentation C. publishing D. database
Assume that, in the anonymous electronic cash protocol, the bank is honest but the customer and the merchant might not be.
a. After receiving the tokens from the bank, the customer later claims that she never received them. Explain what the bank should then do and why it is correct. b. After receiving the message containing the purchase order and the tokens from the customer, the merchant claims never to have received the message. Explain what the customer should do and why.
The ____ fill allows you to remove objects from a photograph and replace them with similar versions of the surrounding pixels.
a. Photograph Removal b. Pixel-Removal c. Photo-Editing d. Content-Aware
Visual Basic's ____ class contains many methods that your applications can use to perform financial calculations.
A. Money B. Monetary C. Finance D. Financial