Hi I am doing the true or false project and am having a problem with step 21. The code runs but all of the responses are showing as true and the score is not updating properly. I watched the get help video which shows the same problem but after the scoringIndex is updated it should return the correct values.

The input above should be true, false, true, false, true and return a score of 5. Has anybody else had the same problem.
I can post the code if needed.
1 Like
Hello @css9376310513, welcome to the forums! Yes, could you post your code and a link to the exercise, please? Review ->this<- post to see how to correctly format your code.
Hi @codeneutrino
Thank you for your reply. The link to the exercise and code are below.
https://www.codecademy.com/courses/learn-c-sharp/projects/csharp-true-or-false
using System;
namespace TrueOrFalse
{
class Program
{
static void Main(string[] args)
{
// Do not edit these lines
Console.WriteLine("Welcome to 'True or False?'\nPress Enter to begin:");
string entry = Console.ReadLine();
Tools.SetUpInputStream(entry);
// Type your code below
string[] questions = {"1: True or false – the five rings on the Olympic flag are interlocking?", "2: True or false – Mount Kilimanjaro is the highest mountain in the world?", "3: True or false – a group of swans is known as a bevy?", "4: True or false – Sydney is the capital of Australia?", "5: True or false – fish cannot blink?"};
bool[] answers = {true, false, true, false, true};
bool[] responses = new bool[5];
if (questions.Length != answers.Length)
{
Console.WriteLine("The number of questions is not equal to the number of answers.");
}
int askIndex = 0;
foreach (string question in questions)
{
string input;
bool isBool;
bool inputBool;
Console.WriteLine(question);
Console.WriteLine("True or False?");
input = Console.ReadLine();
isBool = Boolean.TryParse(input, out inputBool);
while (!isBool)
{
Console.WriteLine("Please respond with 'true' or 'false'.");
input = Console.ReadLine();
isBool = Boolean.TryParse(input, out inputBool);
}
responses[askIndex] = isBool;
askIndex++;
}
int scoringIndex = 0;
int score = 0;
foreach (bool answer in answers)
{
bool response = responses[scoringIndex];
Console.Write(scoringIndex + 1 + ".");
Console.WriteLine($"Input: {response} | Answer: {answer}");
if (response == answer)
{
score ++;
}
scoringIndex++;
}
Console.WriteLine($"You got {score} out of {questions.Length} correct!");
}
}
}
1 Like
appreciate for sharing the code 
Try changing:
responses[askIndex] = isBool;
askIndex++;
to:
responses[askIndex] = inputBool;
askIndex++;
I will be sure not to in the future. Are you willing to elaborate on why it’s not allowed, I didn’t see a reason in the link you provided. I’m just curious.
Thank you