I've been trying to make a very simple program for my wife's birthday. it uses a basic if else statement but I cant get it to work right. it's also the first interactive program I've ever written. here is the code
#include <iostream>
#include <string>
using namespace std;
int main()
{
string YourName;
cout <<"let's see how hot you are.\n";
cout <<"Your name please";
getline (cin, YourName);
if (???? == ????)
cout <<"You're HOT!";
else
cout <<"eeeeeehhhhhhh........whatever.";
system ("pause");
}
I believe all I need is to find out what to put in the if statement where the ???? is I would know what in do if it were numbers but the strings seem to be getting the better of me. if the whole code is completely wrong please tell me.
This code doesnt make a lot of sense. When must the program display "You're Hot!" and when "eeeeeeeehhhhhh....whatever."?
In this case, there are some sintax errors, but bisides that, the program will always display "you're hot", since ????==???? is always true (it is the same).
My problem persists. the code now looks like this.
#include <iostream>
#include <string>
using namespace std;
int main()
{
string YourName;
cout <<"let's see how hot you are.\n";
cout <<"Your name please";
getline (cin, YourName);
if (YourName == Amy)
{
cout <<"You're HOT!";
}
else
{
cout <<"eeeeeehhhhhhh........whatever.";
}
system ("pause");
}
I keep getting a message telling me amy is undeclared. but I dont want it to be a variable. I just want it to display message 1 when her name is entered. am I missing a basic principal?
thank you very much. that was an embarrassing problem but I'm glad to see experienced programmers taking the time to help ot beginners. thank you again.