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(""); } }
static void Main(string[] args) { Info newInfo = new Info(); newInfo.DispInfo(); HiLowUI newobj = new HiLowUI(); newobj.PlayGame(); }
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(""); } } }
public int CreateGoal() { HiLowUI newobj = new HiLowUI(); string level = newobj.Menu(); switch (level) { case "1": Console.WriteLine(""); Console.WriteLine("Please enter a number between 1 and 10"); CreateGoalEasy(); break; case "2": Console.WriteLine(""); Console.WriteLine("Please enter a number between 1 and 50"); CreateGoalMedium(); break; case "3": Console.WriteLine(""); Console.WriteLine("Please enter a number between 1 and 100"); CreateGoalDifficult(); break; default: Console.WriteLine(""); Console.WriteLine("Please enter a valid input : 1, 2 or 3"); break; } return Goal; }