#include #include #include struct Profile { std::string name; int age; std::string interests; }; void fillProfiles(std::vector& profiles) { profiles.push_back({"John", 18, "sports, music"}); profiles.push_back({"Mary", 20, "art, movies"}); profiles.push_back({"Bob", 22, "cooking, reading"}); profiles.push_back({"Sue", 24, "travel, photography"}); profiles.push_back({"Greg", 26, "hiking, fishing"}); profiles.push_back({"Julie", 28, "dancing, theatre"}); profiles.push_back({"Dave", 30, "gaming, programming"}); profiles.push_back({"Rachel", 32, "painting, writing"}); } void showProfile(const Profile& profile) { std::cout << "Name: " << profile.name << std::endl; std::cout << "Age: " << profile.age << std::endl; std::cout << "Interests: " << profile.interests << std::endl; } // Returns true if the user likes the profile, false otherwise bool likeProfile(const Profile& profile) { std::string response; std::cout << "Do you like " << profile.name << "? (y/n): "; std::cin >> response; if (response == "y") { return true; } return false; } // Returns true if the user super likes the profile, false otherwise bool superLikeProfile(const Profile& profile) { std::string response; std::cout << "Do you super like " << profile.name << "? (y/n): "; std::cin >> response; if (response == "y") { return true; } return false; } // Returns true if the user dislikes the profile, false otherwise bool dislikeProfile(const Profile& profile) { std::string response; std::cout << "Do you dislike " << profile.name << "? (y/n): "; std::cin >> response; if (response == "y") { return true; } return false; } int main() { std::vector profiles; fillProfiles(profiles); std::cout << "Welcome to the dating app!" << std::endl; std::cout << "Please enter your profile information:" << std::endl; Profile user; std::cout << "Name: "; std::cin >> user.name; std::cout << "Age: "; std::cin >> user.age; std::cout << "Interests: "; std::cin >> user.interests; while (profiles.size() > 0) { // Choose a random profile // std::random_shuffle(profiles.begin(), profiles.end()); std::random_device rd; std::mt19937 g(rd()); std::shuffle(profile.begin(), profile.end(), g); Profile profile = profiles.back(); profiles.pop_back(); // Show the profile showProfile(profile); // Ask the user to like, super like, or dislike the profile bool liked = false; bool superLiked = false; bool disliked = false; liked = likeProfile(profile); if (liked) { superLiked = superLikeProfile(profile); } else { disliked = dislikeProfile(profile); } } std::cout << "No more profiles!" << std::endl; return 0; }