jeudi 23 février 2017

Invalid Expression Term in If...Else Statement C#

While trying to make a console application in VSL studio 2012 that outputs advice on what to wear, depending on the temperature inputted by the user, I am running into the error "Invalid Expression Term" on every else if statement I have in this code. I have no idea as to what I am doing wrong here.

If someone could point me in the right direction of resolving this issue, that would be amazing! Thank you

if (temp <= 40)
        {
            Console.WriteLine(" It is very cold. Put on a heavy coat.");
        }
        else if (temp > 40 && <= 60)
        {
            Console.WriteLine("It is cold. Put on a coat.");
        }
        else if (temp > 60 && <= 70)
        {
            Console.WriteLine("The temperature is cool. Put on a light jacket.");
        }
        else if (temp > 70 && <= 80)
        {
            Console.WriteLine("The temperature is pleasent. You can wear anything you like");
        }
        else if (temp > 80 && <= 90)
        {
            Console.WriteLine(" The temperautre is warm, you can wear short sleeves.");
        }
        else (temp > 90)
        {
            Console.WriteLine("It is hot. You can wear shorts today.");
        }

Aucun commentaire:

Enregistrer un commentaire