Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Letter{
  6. private:
  7. char c;
  8. public:
  9. Letter(char a){
  10. c = a;
  11. }
  12.  
  13. void print(){
  14. cout << c << endl;
  15. }
  16.  
  17. void changeTo(char a){
  18. c = a;
  19. }
  20.  
  21. char toLowerCase(){
  22. return tolower(c);
  23. }
  24.  
  25. char toUpperCase(){
  26. return toupper(c);
  27. }
  28.  
  29. bool isVowel() {
  30. char ch = tolower(c);
  31. if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u' || ch == 'y')
  32. return true;
  33. else return false;
  34. }
  35. };
  36.  
  37. int main() {
  38. Letter a('a');
  39.  
  40. Letter b('B');
  41.  
  42. cout << a.isVowel() << endl;
  43. cout << b.isVowel() << endl;
  44. cout << a.toUpperCase() << endl;
  45. cout << b.toLowerCase() << endl;
  46.  
  47.  
  48.  
  49. return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement