was not declared in this scope

// Please help


#include <iostream>
#include <cmath>

using namespace std;

int main()
{
int answer;
int answer2;
int answer3;

if (answer == 13)
{


cout << "How old is Max?" << endl;
cin >> answer;
cout << "Excellent Job!";
}
else


cout << "Incorrect, Max is 13" << endl;
cout >> "Moving on..." << endl;
{

}
if (answer2 == spongebob)
cout << "What is Max's favorite show?" <, endl;
cin >> answer2;
cout << "Excellent Job!";
else

cout << "Incorrect, Max's favorite show is Spongebob Squarepants" << endl;
cout >> "Moving on... \n";

if (answer3 == Potato)
cout << "HOW DID YOU GET THAT?! That is probably the most far fetched, random answer EVER!"
cin >> answer3;

else
cout << "Wrong, incorrect, just plain WRONG! YOU HAVE FAILED!";








return 0;
}
if (answer2 == spongebob)

What kind of object is spongebob? Is that an int? A double? A char? Or did you perhaps mean

if (answer2 == "spongebob")?

I note that you are testing the value of answer like this
if (answer == 13)
before the user enters a value. Is that the best way to do it? Maybe you should have the user enter their words, and then test those values?
You're right, this was a while ago, juist some coding from when I was kindof a newbie. So I thought I would post it to see if anybody could help, and what you said helped a ton, thanks!
Topic archived. No new replies allowed.