I just met this girl and she is a programmer and proficient in C++. I just know some VBA etc.
I wanted to ask her out on a date, but wanted to write her in C++ code.
Could someone provide me with a short code to do so? that would be awesome :-)
I thought about like calling the routine "Date" and to ask her out for a date. leaving her to answer "Yes" or "no". But when it says "no" it leads to an error and to run again until she says "yes" ;-)
#include <iostream>
#include <algorithm>
#include <string>
void Date(std::string &ans);
int main()
{
std::string answer;
do {
Date(answer);
} while (answer != "yes");
std::cout << "See you on Monday at 7?"; // final message
return 0;
}
void Date(std::string &ans)
{
std::cout << "Will you come out for a date with me? ";
std::cin >> ans;
std::transform(ans.begin(), ans.end(), ans.begin(), ::tolower);
if (ans != "yes")
std::cout << "****** Error, answer not accepted, try again!" << std::endl;
}