How do I make an if statement of these..

Hello!

I'm on a little project to teach myself the japanese language. I'd like to learn the basic vocabulary and I'd like to code a little program to help myself with it like for an exampe it says say the english word for 'konnichiwa' and I'd have to enter the right translation(Hello).

But I'm having an issue right here. The problem is how I can connect the random shown string with the english word. So when I enter the english word, it checks the random word but how do I connect them?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  string greetingsJapanese[4] = { "Ohayo", "Konnichiwa", "Konbanwa", "Oyasuminasai" }; // ARRAY OF JAPANESE GREETINGS
			string greetingsEnglish[4] = { "Good morning", "Hello", "Good evening", "Good night" }; // ARRAY OF ENGLISH GREETINGS

			srand(time(NULL));
			int RandIndex = rand() % 4;
			cout << greetingsJapanese[RandIndex] << endl;

			int greetingsAnswer;

			cin >> greetingsAnswer;

if(greetingsAnswer == greetingsJapanese[RandIndex](????????????))
{
cout << "The answer is correct!" << endl;
}

else
{
cout << "Wrong answer! Please try again." << endl;
}

Index greetingsEnglish with the same RandIndex and do:
 
if(greetingsAnswer == greetingsEnglish[RandIndex]


Make sense?
Topic archived. No new replies allowed.