mercredi 1 avril 2020

How to check if student wrote a bad word? [closed]

I have a dictionary of all curse words. I want a student to write any statement and the program should display whether student cursed or not.

 internal void CheckIfStudentDidntCursed()
{
    var cursedwords = File.ReadAllLines("C:\\Users\\Lenovo\\source\\repos\\CS-labs\\CS-lab\\data\\wulgaryzmy.txt");

    Console.WriteLine("Write a statement: ");
     Console.ReadLine();
    {
        if (Console.ReadLine() )
        {
            Console.WriteLine("Student cursed.");
        }
        else
        {
            Console.WriteLine("Student did not curse.");
        }
    }
}

I am a begginer and I need some advice.

Aucun commentaire:

Enregistrer un commentaire