Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Boolean
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
M49913




PostPosted: Sun Jun 07, 2009 6:23 pm   Post subject: Boolean

What is it you are trying to achieve?
I just need something to display if the inputted number is bigger or equal to 1 or less than or equal to 16

What is the problem you are having?
Syntax error at <


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:

    if answer (1) => 1 or answer (1) =< 16 then
    put answer (1), " of product number ", answer (1)
    end if



Please specify what version of Turing you are using
<Answer Here>
Sponsor
Sponsor
Sponsor
sponsor
DtY




PostPosted: Sun Jun 07, 2009 6:52 pm   Post subject: RE:Boolean

</> comes before the =
so:
<= and >=
not
=< and =>
BigBear




PostPosted: Sun Jun 07, 2009 7:08 pm   Post subject: RE:Boolean

Are you using and array and referring to element 1 or character 1 of the string?
zero-impact




PostPosted: Sun Jun 07, 2009 8:03 pm   Post subject: RE:Boolean

You have a logic error as well. Think about what it is saying. The number is greater than 1 OR less than 16?

Dty is correct, it should be >= and <=.
Kharybdis




PostPosted: Sun Jun 07, 2009 9:04 pm   Post subject: RE:Boolean

Turing:

if answer (1) >= 1 and answer (1) <= 16 then
    put answer (1), " of product number ", answer (1)
end if
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: