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

Username:   Password: 
 RegisterRegister   
 Some one look at this i need help please
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Slnj




PostPosted: Fri Mar 26, 2010 5:54 am   Post subject: Re: RE:Some one look at this i need help please

syntax_error @ Thu Mar 25, 2010 9:19 pm wrote:
You compare data.

if var1 > var2 then do bhal
if not then do bhal2

etc.


i didn't learn the 'if' statement yet, I have to use all the methods i learned which are for loops, loops, and all the simple stuff.
Sponsor
Sponsor
Sponsor
sponsor
Turing_Gamer




PostPosted: Fri Mar 26, 2010 7:37 am   Post subject: RE:Some one look at this i need help please

if statement is very self explanitory. With this command you can do a function only when certain parameters are met. For example...
Turing:
var num1, num2 : int
put " Enter a number..."
get num1
put " Enter another number..."
get num2
%PAY ATTENTION HERE
if num1 > num2 then % Ask for specific test
    put " The first number is bigger than the second."
elsif num1 < num2 then % Ask for another specific test
    put " The second number is bigger than the first."
elsif num1 = num2 then % Ask for again another specific test
    put " Both numbers are the same"
else % If all else fails
    put " SYNTAX ERROR!!"
end if
USEC_OFFICER




PostPosted: Fri Mar 26, 2010 11:47 am   Post subject: RE:Some one look at this i need help please

How do you not learn if statements! The if statement is the simplest part of Turing! How do you even exit from a loop! I shouldn't end each sentence with an exclamation mark! *Shocked face*
Slnj




PostPosted: Fri Mar 26, 2010 2:46 pm   Post subject: RE:Some one look at this i need help please

k nvm im just going to use the if statement.. here's what i got so far but having trouble

Quote:
var money, a, b : real
put "What is the amount of money? "
get money

if money >100 then
a := money div 100 put a ," hundered dollar bill "
elsif a >50 then
b := a mod 50 put b, " fifty dollar bill "
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 2 of 2  [ 19 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: