help loop 2

it just wont run and i just got help and put that in but im not sure i did it right because it wont run
other forum post: http://www.cplusplus.com/forum/beginner/123661/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <iostream>
#include <string>

using namespace std;

int main()
{
string ans, name;
		
		cout << "Hello what is your name" << endl;
		cin >> name;
		cout << "Nice to meet your " << name << endl;
while (true)   //infinite loop
{
		cout << "How is your day " << name << endl;
		cin >> ans;
// if (ans.eguals("good"))
	if (ans == "good")
		{
			cout << "Thats good, enjoy the rest of your day" << endl;
			break;    //here it will exit the loop the same for all the else if
		}
// if (ans.equals("fine"))
	else if (ans == "fine")
		{
			cout << "Just fine not good" << endl;
			break;    //here it will exit the loop the same for all the else if
		}
// if (ans.equals("bad"))
	else if (ans == "bad")
		{
			cout << "Thats too bad, i hope you have a better day tomarrow" << endl;
			break;    //here it will exit the loop the same for all the else if
		}
//if (ans.equals("great"))
	else if (ans == "great")
		{
			cout << "thats awesome to hear" << endl;
			break;    //here it will exit the loop the same for all the else if
		}
//if (ans.equals("terible"))
	else if (ans == "terible")
		{
			cout << "thats terible to here, im sorry" << endl;
			break;    //here it will exit the loop the same for all the else if
		}
	else
		{
			cout << "sorry thats none of the choices try good, fine, bad, great, or terible, thank you" << endl;
			continue;     //will reloop (test the condition and since it's true reloop)
		}
}
it wont run

Please explain.
You forgot to close int main

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
#include <string>

using namespace std;

int main()
{
string ans, name;
		
		cout << "Hello what is your name" << endl;
		cin >> name;
		cout << "Nice to meet your " << name << endl;
while (true)   //infinite loop
{
		cout << "How is your day " << name << endl;
		cin >> ans;
// if (ans.eguals("good"))
	if (ans == "good")
		{
			cout << "Thats good, enjoy the rest of your day" << endl;
			break;    //here it will exit the loop the same for all the else if
		}
// if (ans.equals("fine"))
	else if (ans == "fine")
		{
			cout << "Just fine not good" << endl;
			break;    //here it will exit the loop the same for all the else if
		}
// if (ans.equals("bad"))
	else if (ans == "bad")
		{
			cout << "Thats too bad, i hope you have a better day tomarrow" << endl;
			break;    //here it will exit the loop the same for all the else if
		}
//if (ans.equals("great"))
	else if (ans == "great")
		{
			cout << "thats awesome to hear" << endl;
			break;    //here it will exit the loop the same for all the else if
		}
//if (ans.equals("terible"))
	else if (ans == "terible")
		{
			cout << "thats terible to here, im sorry" << endl;
			break;    //here it will exit the loop the same for all the else if
		}
	else
		{
			cout << "sorry thats none of the choices try good, fine, bad, great, or terible, thank you" << endl;
			continue;     //will reloop (test the condition and since it's true reloop)
		}
}
return 0;
}
thank you now i fix my first fully operational conversation
Topic archived. No new replies allowed.