✅ Beginner help

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Exercise_2_Task_1
{
internal class Program
{
static void Main(string[] args)
{
int testscore = 0;


do
{
Console.WriteLine();
Console.Write("Input test score: ");
testscore = Convert.ToInt32(Console.ReadLine());



if (testscore == -1)
{
Console.Write("Well done, Pres ENTER To Exit....");
Console.ReadLine();
Console.WriteLine();
Environment.Exit(0);
}

else if (testscore < -1)
{
Console.WriteLine("Invalid Integer. Please Retry");
}

else if (testscore > 100)
{
Console.WriteLine("Invalid Integer. Please Retry");
}


else if (testscore >= 0 && testscore <= 49)
{
Console.WriteLine("You need to put in more work!");
}
else if (testscore >= 50 && testscore <= 79)
{
Console.WriteLine("Could you do better? ");
}

else if (testscore >= 80 && testscore <= 100)
{
Console.WriteLine("Well Done!");
}
} while (true);

}
}
}


How can i make it so if they enter like a word 'dog' it says invalid. And Re loops again
Was this page helpful?