Guest User

Untitled

a guest
Jul 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. char input{};
  7. unsigned short vowels{ 0 }, consonants{ 0 };
  8. cout << "Vowel Countern";
  9.  
  10. do
  11. {
  12. cout << "Enter any letter(Q or q to terminate): ";
  13. cin >> input;
  14.  
  15. switch (input)
  16. {
  17. case 'a':
  18. vowels += 1;
  19. break;
  20. case 'e':
  21. vowels += 1;
  22. break;
  23. case 'i':
  24. vowels += 1;
  25. break;
  26. case 'o':
  27. vowels += 1;
  28. break;
  29. case 'u':
  30. vowels += 1;
  31. break;
  32. default:
  33. consonants += 1;
  34. break;
  35. }
  36. } while ((input != 'q') || (input != 'Q'));
  37.  
  38. cout << "Vowels entered: " << vowels << "nConsonants entered: " << consonants << endl;
  39.  
  40. return 0;
Add Comment
Please, Sign In to add comment