need help with VB6 programming

Status
Not open for further replies.
for school we have to make the following program:

Code:
Develop a program that will test the user on a number of addition, subtraction, multiplication and division problems.

 

The user will specify the number (i.e. no. of questions) they wish to answer, as well as the type (i.e. operation such addition, subtraction, etc.) of problems.

There will be a time limit of 5 seconds per question; if the question is not answered in time or there is an incorrect response, 10 points will be deducted from their score. 20 points are added to the score for each correct answer.

For subtraction questions, ensure that the answer is always positive, i.e. the first number must be greater than the second number (e.g. 100 – 50)

For division questions, ensure that the answer will always produce an integer, e.g. 100 / 10 NOT 100 / 30

Note: The numbers that are produced for the questions are random.

 

Other game features:

Error checks to ensure that invalid answers can’t be entered by the user

Use of levels, i.e. lower levels for easier questions, higher levels for more difficult questions.

Use of images, colour, etc. to enhance the game experience

When the problems are finished, the user should be given a score.



for division, our teacher told us to use this:

Code:
Do Until num1 > num2 And num1 / num2 = Int(num1 / num2)

so i put it as this:

Code:
        lblOperator.Caption = "/"

        'generate random number

        Do Until num1 > num2 And num1 / num2 = Int(num1 / num2)

        Randomize

        num1 = Int(Rnd * 5) + 1

        Randomize

        num2 = Int(Rnd * 5) + 1

        Exit Do

        lblNum1.Caption = num1

        lblNum2.Caption = num2

        Loop



but i always get an overflow error (run-time error '6': overflow). if you know anything about this stuff i would <3 you forever!!!
 
Status
Not open for further replies.

Users who are viewing this thread

Top