# True or False Quiz Help • ### Question

• Earlier this week I started to make a(text.window based) true or false quiz that has 5 questions and counts up the scores and displays them at the end, however I can't seem to get it working.

Please would someone be able to help with this?

Monday, February 8, 2016 8:26 AM

• firstly, Variables can't just be numbers. So when you have

It needs to be V5 or Var5 or Q5 or somthing. It can't be just 5. The same goes for all the other questions.

You also need to say

score = score + N2

score + N2

also, you need and EndIf after the score checker.

Here is the modified code:

```begin:
TextWindow.WriteLine("Welcome to My Quiz!")
Program.Delay(1600)
TextWindow.WriteLine("    ... And you will simply anwser 'true' or 'false'")
Program.Delay(1600)
score = 1
N1 = 1
N2 = 2
N3 = 3
N4 = 4
N5 = 5
TextWindow.WriteLine("Question 1. ")
If Q1 = "true" Then
score = score + N1
EndIf

TextWindow.WriteLine("Question 2. ")
If Q2 = "true" Then
score = score + N2
EndIf

TextWindow.WriteLine("Question 3. ")
If Q3 = "true" Then
score = score + N3
EndIf
TextWindow.WriteLine("Question 4. ")
If Q4 = "true" Then
score = score + N4
EndIf
TextWindow.WriteLine("Question 5. ")
If Q5 = "true" Then
score = score + N5
EndIf

If score = 16 Then
TextWindow.WriteLine("Well done, You have got 5 out of 5!")
EndIf
Goto begin
```

It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

Monday, February 8, 2016 6:23 PM
• You cannot have variables called 1 or 2 ...  Variable names should start with a letter or _ (underscore)

Jan [ WhTurner ] The Netherlands

Monday, February 8, 2016 6:24 PM

### All replies

• What is the problem? Do you get syntax errors when yoou try to run the program? Do you get the wromng answers?

Jan [ WhTurner ] The Netherlands

Monday, February 8, 2016 2:26 PM
• begin:
TextWindow.WriteLine("Welcome to My Quiz!")
Program.Delay(1600)
TextWindow.WriteLine("    ... And you will simply anwser 'true' or 'false'")
Program.Delay(1600)
score = 1
N1 = 1
N2 = 2
N3 = 3
N4 = 4
N5 = 5
TextWindow.WriteLine("Question 1. ")
If 1 = "true" Then
score + N1
EndIf

TextWindow.WriteLine("Question 2. ")
If 2 = "true" Then
score + N2
EndIf

TextWindow.WriteLine("Question 3. ")
If 3 = "true" Then
score + N3
EndIf
TextWindow.WriteLine("Question 4. ")
If 4 = "true" Then
score + N4
EndIf
TextWindow.WriteLine("Question 5. ")
If 5 = "true" Then
score + N5
EndIf

If score = 16 Then
TextWindow.WriteLine("Well done, You have got 5 out of 5!")

Goto begin

**********************************************************

That was my program so far, however I can't seem to get a score checker working.

Would you be able to help with this?

• Edited by Monday, February 8, 2016 6:05 PM
Monday, February 8, 2016 5:59 PM
• firstly, Variables can't just be numbers. So when you have

It needs to be V5 or Var5 or Q5 or somthing. It can't be just 5. The same goes for all the other questions.

You also need to say

score = score + N2

score + N2

also, you need and EndIf after the score checker.

Here is the modified code:

```begin:
TextWindow.WriteLine("Welcome to My Quiz!")
Program.Delay(1600)
TextWindow.WriteLine("    ... And you will simply anwser 'true' or 'false'")
Program.Delay(1600)
score = 1
N1 = 1
N2 = 2
N3 = 3
N4 = 4
N5 = 5
TextWindow.WriteLine("Question 1. ")
If Q1 = "true" Then
score = score + N1
EndIf

TextWindow.WriteLine("Question 2. ")
If Q2 = "true" Then
score = score + N2
EndIf

TextWindow.WriteLine("Question 3. ")
If Q3 = "true" Then
score = score + N3
EndIf
TextWindow.WriteLine("Question 4. ")
If Q4 = "true" Then
score = score + N4
EndIf
TextWindow.WriteLine("Question 5. ")
If Q5 = "true" Then
score = score + N5
EndIf

If score = 16 Then
TextWindow.WriteLine("Well done, You have got 5 out of 5!")
EndIf
Goto begin
```

It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

Monday, February 8, 2016 6:23 PM
• You cannot have variables called 1 or 2 ...  Variable names should start with a letter or _ (underscore)

• • 