Qbasicnews.com

Full Version: Adding!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can i get the program to add a number to another figure when i reach a certain point.

For example

If i made a quiz where the contestant gets 3 points for a correct answer how would i add that 3 points to his total. He has an option to view his stats and i want the points to add to his total points in his stats.

HELP!!!

Tom
maybe by intializing a variable TOTAL to zero, e.g.,

TOTAL = 0

and then in your loop (or whatever) doing something like

TOTAL = TOTAL + POINTS

(Why do I have a sinking feeling that I totally misunderstood your question?)
does it check if he got the right answer directly after the question?
like this

Code:
Contestant1.points  = 0

INPUT " Question 1, Do I rule? ", question1$

IF question1$ = "yes" THEN

Contestant1.points  = Contestant1.points  + 1

ELSE

Contestant1.points  = Contestant1.points - 1

In the last line, you could just have Contestant1.points = Contestant1.points , which would mean you don't lose any points.

Was that your question ?
That was exactly wot i wanted!!!

thanks. il giv it a try!!