option 4 and option 5 doesnt work
i dont understand how to fix it im so consfuse
7 Replies
Define "doesn't work"
Where's the code that actually lets the user select the options?
[21:25, 04/03/2023] Z.: where is the code for the user to select the options ah
[21:28, 04/03/2023] Yang Heng: public static string Intro()
{
Console.WriteLine(" **Main page***");
Console.WriteLine("**");
Console.WriteLine("Select Option");
Console.WriteLine("1. Display files in Image Folder");
Console.WriteLine("2. Display files in Text Folder");
Console.WriteLine("3. Display files in Text + Images Folder");
Console.WriteLine("4. Perform sorting of files to image and text folders");
Console.WriteLine("5. Perform check on abnormal content in text file");
return "complete intro";
}
This just displays some text
Where's the code that takes the input from the user, and then calls
Option1()
, Option4()
etc. methods?Yes, all Console.WriteLine does is display the text you supplied it to the console, to read user inputs, you need to use either Console.ReadKey() or Console.ReadLine(), depending on whether you need to read a character or a string input
You'll also have to ensure that whatever the user inputted is one of the expected inputs
thanks for the all the help i had figured it out