Hi Art,
You can call the ConOR and ConAND methods directly from your Main() method. The way you've structured the ConOR and ConAND methods, they don't need any parameters:
class Program
{
/* verbose */
static void Main(string[] args1)
{
int number;
Console.WriteLine("Please enter a number between 0 and 10:");
number = int.Parse(Console.ReadLine());
if (number > 10)
Console.WriteLine("Hey! The number should be 10 or less!");
else
if (number < 0)
Console.WriteLine("Hey! The number should be 0 or more!");
else
Console.WriteLine("Good job!");
ConOR();
ConAND();
}
/// using || which is C# for OR
static void ConOR()
{
int number_or;
Console.WriteLine("Please enter a number between 10 and 20:");
number_or = int.Parse(Console.ReadLine());
if ((number_or > 20) || (number_or < 10))
Console.WriteLine("Hey! The number should be more than 10 or more and less than 20!");
else
Console.WriteLine("Good job!");
}
/// using && which is C# for AND
static void ConAND()
{
int numAND;
Console.WriteLine("Please enter a number between 20 and 30:");
numAND = int.Parse(Console.ReadLine());
if ((numAND < 30) && (numAND > 20))
Console.WriteLine("Good job!");
else
Console.WriteLine("Hey! The number should be more than 20 or more and less than 30!");
}
}