public void Compare() { HiLowUI newobj = new HiLowUI(); num = newobj.PromptforInteger(); if (num == Goal) { Console.WriteLine(""); Console.WriteLine("Display Result : Correct"); Console.WriteLine(""); newobj.PlayGame(); } else if (num > Goal) { Console.WriteLine(""); Console.WriteLine("Display Result : Too High"); Console.WriteLine(""); } else { Console.WriteLine(""); Console.WriteLine("Display Result : Too Low"); Console.WriteLine(""); } }
public void Compare() { HiLowUI newobj = new HiLowUI(); num = newobj.PromptforInteger(); if (num > 100) { Console.WriteLine(""); Console.WriteLine("Invalid Entry, Please enter a number between 1 and 100 only"); Console.WriteLine(""); } else if (num < 1) { Console.WriteLine(""); Console.WriteLine("Invalid Entry, Please enter a number between 1 and 100 only"); Console.WriteLine(""); } else { if (num == Goal) { Console.WriteLine(""); Console.WriteLine("Display Result : Correct"); Console.WriteLine(""); newobj.PlayGame(); } else if (num > Goal) { Console.WriteLine(""); Console.WriteLine("Display Result : Too High"); Console.WriteLine(""); } else { Console.WriteLine(""); Console.WriteLine("Display Result : Too Low"); Console.WriteLine(""); } } }