Wednesday, 17 October 2012

revised task No.1

here is there revised task number one . i have made some changes and commented in the actual code.



//This code is done by aidan quinn
// an if statment is a stament that does somthing if the stament is true and does somthing else if is not.
var temp = prompt("hey there, whats the temperature?");
console.log(temp);
if( temp < 0)
{
        alert("It’s freezing out there!")
}
else
{
        if( 25 > temp > 0)
        {
                alert("You don’t need skis or board shorts!")
       
        }
        else
        {
                if(temp > 25)
                {
                        alert("It’s hot out there!")
                       
                }
                else
                {
        alert("silly billy " + temp + " Is not a temperature")
                }
               
        }
}


No comments:

Post a Comment