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

Username:   Password: 
 RegisterRegister   
 right or wrong counter
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ecookman




PostPosted: Thu Nov 27, 2008 11:13 am   Post subject: right or wrong counter

i am trying to make a simple game where you answer questions...


after you ask a question it tells you if you are right or wrong. I am trying to figure out how to at the end say like you got 3 out of 5 correct....BUT how in the hell do i do this...

i could only think of something like this but i know it is completely wrong and i am like o.k now what..

help would be greatly appreciated


Turing:

var a1 : int
var a2 : int
var a3 : int
var a4 : int
var a5 : int
var t : int = (1)

put " what is 1+1*0"
get a1
if a1 > 1 or a1 < 1 then
    put "wrong"
else
    put "correct"
t+1
end if

put "what is 695-694"
get a2
if a2 > 1 or a2 < 1 then
    put "wrong"
else
    put "correct"
t+1
end if

put "what is the square route of 1 "
get a3
if a3 > 1 or a3 < 1 then
    put "wrong"
else
    put "correct"
t+1
end if



put "what is 1+1-1*1/1"
get a4
if a4 > 1 or a4 < 1 then
    put "wrong"
else
    put "correct"
t+1
end if

put " if someone gave you $10 and you spent 9$ how much money would you have after weeks"
get a5

if a5 > 1 or a5 < 1 then
    put "wrong"
else
t+1
    put "correct"
end if
delay (1000)
put" you final score is ", t-1, "out of 5"




ya os if someone could point me in the right direction that would be nice... BooHoo Mr. Green
Sponsor
Sponsor
Sponsor
sponsor
ecookman




PostPosted: Thu Nov 27, 2008 11:24 am   Post subject: Re: right or wrong counter

hahahahahaha the joke is on me i made a extremely dumb error


here is what it should be

Turing:

var a1 : int
var a2 : int
var a3 : int
var a4 : int
var a5 : int
var t : int := (1)

put " what is 1+1*0"
get a1
if a1 > 1 or a1 < 1 then
    put "wrong"
else
    put "correct"
t:= t+1
end if

put "what is 695-694"
get a2
if a2 > 1 or a2 < 1 then
    put "wrong"
else
    put "correct"
t:= t+1
end if

put "what is the square route of 1 "
get a3
if a3 > 1 or a3 < 1 then
    put "wrong"
else
    put "correct"
t:= t+1
end if



put "what is 1+1-1*1/1"
get a4
if a4 > 1 or a4 < 1 then
    put "wrong"
else
    put "correct"
t:= t+1
end if

put " if someone gave you $10 and you spent 9$ how much money would you have after weeks"
get a5

if a5 > 1 or a5 < 1 then
    put "wrong"
else
t:= t+1
    put "correct"
end if
delay (1000)
put" you final score is ", t-1, " out of 5"



my problem was i just put

t+1

it should be as is now
i thought i shouldn't remove my pose because someone might also have this problem
man...that was so dumb i wanna hangmy self (jk)
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  [ 2 Posts ]
Jump to:   


Style:  
Search: