using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { int waterLevel; Console.Write("Water Level: "); waterLevel = int.Parse(Console.ReadLine()); // Check water level and generate alarm if more than 80 // or warning if more than 60 // Check the highest value first if(waterLevel > 80) { Console.WriteLine("Alarm water is about to overflow barrel"); } else { // Values above 80 have already been handled above, so we can // now check for values above 60. if (waterLevel > 60) { Console.WriteLine("Warning water level is getting too high"); } else { // Don't need to check for less than or equal to 60 because // all values above 60 have been handled above. Console.WriteLine("Situation normal"); } } Console.ReadKey(); // Pause } } }