Write a program that asks a user for an IQ score. If the score is a number less than 0 or greater
than 200, issue an error message. Otherwise issue a message according to the following values:
Under 100 Below average
100 Average
Above 100 Above average
using System;
namespace IQCalculator
{
class Program
{
static void Main(string[] args)
{
int IQ = -1;
Console.WriteLine("Enter your IQ level");
IQ = int.Parse(Console.ReadLine());
if (IQ < 0 || IQ > 200)
Console.WriteLine("Check if the data is correct");
if (IQ > 0 && IQ < 100)
Console.WriteLine("Below the average");
if (IQ == 100)
Console.WriteLine("Middle");
if (IQ > 100 && IQ < 200)
Console.WriteLine("Above the average");
}
}
}
Comments
Leave a comment