Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6.  
  7. {
  8. string response;
  9. bool cpp;
  10. bool python;
  11. bool mysql;
  12. bool java;
  13.  
  14. cout << "Do you like C++?\n\n";
  15. getline(cin, response);
  16. if (response[0] == 'Y' || response[0] == 'y') cpp = true;
  17. else cpp = false;
  18. cin.ignore();
  19.  
  20. cout << "\nDo you Python?\n\n";
  21. getline(cin, response);
  22. if (response[0] == 'Y' || response[0] == 'y') python = true;
  23. else python = false;
  24. cin.ignore();
  25.  
  26. cout << "\nDo you like MySQL?\n\n";
  27. getline(cin, response);
  28. if (response[0] == 'Y' || response[0] == 'y') mysql = true;
  29. else mysql = false;
  30. cin.ignore();
  31.  
  32. cout << "\nDo you like Java?\n\n";
  33. getline(cin, response);
  34. if (response[0] == 'Y' || response[0] == 'y') java = true;
  35. else java = false;
  36. cin.ignore();
  37.  
  38. cout << "Programming language(s) you like:\n";
  39. if (cpp) cout << "C++\n";
  40. if (python) cout << "Python\n";
  41. if (mysql) cout << "MySQL\n";
  42. if (java) cout << "Java\n";
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement