64 735
Assignments Done
99,3%
Successfully Done
In September 2018

Answer to Question #51264 in C++ for Zexy

Question #51264
In the You Do It section of this chapter you wrote a program named MaskConvertLetter
that accepts a user’s lowercase letter and converts it to its uppercase equivalent. Now
write a similar program that uses a mask to convert a user’s uppercase entry to its lower-
case equivalent. Save the file as MaskConvertLetter2.cpp.
Expert's answer
.......................................................................................................................
#include <iostream> 
#include <stdlib.h> 
#include <stdio.h>
#include <string>
#include <cctype>
using namespace std;
int main(){
string letter;
cout<<"Enter a letter : ";
getline(cin, letter);
cout<<"You entered : ";
    cout<<letter<<endl;
for(int i = 0; i < letter.size(); i++)
letter[i] = toupper(letter[i]);
cout<<"Uppercase equivalent : "<<letter<<endl;
system&#40;"pause"&#41;;
return 0;
}
.......................................................................................................................
#include <iostream> 
#include <stdlib.h> 
#include <stdio.h>
#include <string>
#include <cctype>
using namespace std;
int main(){
string letter;
cout<<"Enter a letter : ";
getline(cin, letter);
cout<<"You entered : ";
    cout<<letter<<endl;
for(int i = 0; i < letter.size(); i++)
letter[i] = tolower(letter[i]);
cout<<"Lowercase equivalent : "<<letter<<endl;
system&#40;"pause"&#41;;
return 0;
}


........................................................................................................................

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions