just learning qbasic! got into a snag.
Posted: Fri Mar 13, 2009 1:38 pm
the assignment is......
1. Write a program that repeats 20 times.
Use a FOR-NEXT loop that counts
from 1 to 20.
2. Inside the loop, assign random numbers to two variables with the RND function.
The example above shows one random number being chosen
(LET newnumber=RND). Since you
need two random numbers, you will need
two different variables.
3. Now perform simple math with the two random numbers. Add the two random numbers, subtract the two random numbers, multiply the two random numbers, and divide the two
random numbers. Store the answer for
each calculation in a separate variable (something like answer1, answer2, etc.).
4. Inside the loop, use a PRINT USING statement to print your answers in
six columns ( the two random numbers and the results
of the addition, the subtraction, the multiplication, and the division operations.)
I can't get the title "num1" and "num2" to print above 20 randomized numbers... i can get the 20 numbers to randomize only if i dont print the title
somebody help i need help==D!!!
1. Write a program that repeats 20 times.
Use a FOR-NEXT loop that counts
from 1 to 20.
2. Inside the loop, assign random numbers to two variables with the RND function.
The example above shows one random number being chosen
(LET newnumber=RND). Since you
need two random numbers, you will need
two different variables.
3. Now perform simple math with the two random numbers. Add the two random numbers, subtract the two random numbers, multiply the two random numbers, and divide the two
random numbers. Store the answer for
each calculation in a separate variable (something like answer1, answer2, etc.).
4. Inside the loop, use a PRINT USING statement to print your answers in
six columns ( the two random numbers and the results
of the addition, the subtraction, the multiplication, and the division operations.)
I can't get the title "num1" and "num2" to print above 20 randomized numbers... i can get the 20 numbers to randomize only if i dont print the title
somebody help i need help==D!!!