Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- string response;
- bool cpp;
- bool python;
- bool mysql;
- bool java;
- cout << "Do you like C++?\n\n";
- getline(cin, response);
- if (response[0] == 'Y' || response[0] == 'y') cpp = true;
- else cpp = false;
- cin.ignore();
- cout << "\nDo you Python?\n\n";
- getline(cin, response);
- if (response[0] == 'Y' || response[0] == 'y') python = true;
- else python = false;
- cin.ignore();
- cout << "\nDo you like MySQL?\n\n";
- getline(cin, response);
- if (response[0] == 'Y' || response[0] == 'y') mysql = true;
- else mysql = false;
- cin.ignore();
- cout << "\nDo you like Java?\n\n";
- getline(cin, response);
- if (response[0] == 'Y' || response[0] == 'y') java = true;
- else java = false;
- cin.ignore();
- cout << "Programming language(s) you like:\n";
- if (cpp) cout << "C++\n";
- if (python) cout << "Python\n";
- if (mysql) cout << "MySQL\n";
- if (java) cout << "Java\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement